Advertisement
veronikaaa86

05. Concat Names

Jan 18th, 2023
1,006
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. package dataTypes;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P05ConcatNames {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         String firstName = scanner.nextLine();
  10.         String secondName = scanner.nextLine();
  11.         String delimiter = scanner.nextLine();
  12.  
  13. //        System.out.println(firstName + delimiter + secondName);
  14. //        System.out.printf("%s%s%s%n", firstName, delimiter, secondName);
  15.  
  16.         String result = String.format("%s%s%s", firstName, delimiter, secondName);
  17.         System.out.println(result);
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement