-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignement62_.java
More file actions
50 lines (28 loc) · 850 Bytes
/
Assignement62_.java
File metadata and controls
50 lines (28 loc) · 850 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package abhilash_Asignments;
import java.util.InputMismatchException;
import java.util.Scanner;
//WAP in which age,salary,your_weight,are_you_student with try catch block
public class Assignement62_
{
public static void main(String[] args)
{
Scanner x1 = new Scanner (System.in);
//System.out.println(x1);
try {
System.out.println("Enter the Age: ");
x1.nextInt();
System.out.println("Enter the Salary");
x1.nextInt();
System.out.println("Enter ARE YOU A STUDENT");
x1.hasNextBoolean();
Scanner s2 = new Scanner (System.in);
System.out.println("Enter you weight");
s2.nextInt();
System.out.println("thank you");
}
catch (InputMismatchException co) //catch block
{
System.out.println("please enter valid details ");
}
}
}