Advertisement
Spocoman

06. Chars to String

Oct 17th, 2024 (edited)
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         char first = scanner.nextLine().charAt(0),
  7.             second = scanner.nextLine().charAt(0),
  8.             third = scanner.nextLine().charAt(0);
  9.        
  10.         System.out.println(Character.toString(first) + second + third);
  11.         //System.out.printf("%c%c%c\n", first, second, third);
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement