Advertisement
CR7CR7

con5

Sep 23rd, 2022
673
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. public class P05ConcatNames {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         // output John->Smith
  8.         String firstName = scanner.nextLine();
  9.         String secondName = scanner.nextLine();
  10.         String delimeter = scanner.nextLine();
  11.  
  12.         String result = firstName + delimeter + secondName;
  13.  
  14.         System.out.println(result);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement