-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.java
More file actions
28 lines (25 loc) · 725 Bytes
/
input.java
File metadata and controls
28 lines (25 loc) · 725 Bytes
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
import java.lang.*;
import java.io.*;
import java.util.*;
class Sum
{
public static void main (String args[]) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter name, age, salary, sex: ");
String str = br.readLine();
StringTokenizer st = new StringTokenizer(str, ",");
String s1 = st.nextToken();
String s2 = st.nextToken();
String s3 = st.nextToken();
String s4 = st.nextToken();
s1 = s1.trim();
s2 = s2.trim();
s3 = s3.trim();
s4 = s4.trim();
System.out.println("You entered name: " + s1);
System.out.println("You entered age: " + s2);
System.out.println("You entered salary: "+ s3);
System.out.println("You entered sex: "+ s4);
}
}