forked from SLIIT-FacultyOfComputing/sliit-faculty-of-computing-se2012-ooad-practical-02-SE2012-OOAD-Practical_002
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bq1.java
39 lines (22 loc) · 899 Bytes
/
bq1.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.util.Scanner;
public class bq1{
public static void main( String arg[]){
Scanner keyboard = new Scanner(System.in);
System.out.printf("enter first name : ");
String first = keyboard.nextLine();
System.out.printf("enter second name : ");
String second = keyboard.nextLine();
System.out.printf("enter third name : ");
String third = keyboard.nextLine();
System.out.println(first+ " " +second+ " " +third);
System.out.printf("\n------------------------------------\n\n");
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(last);
stringBuilder.append(" ");
stringBuilder.append(fist);
stringBuilder.append(" ");
stringBuilder.append(second);
String result = stringBuilder.toString();
System.out.println("StringBuilder result: " + result);
}
}