-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTryCatchForm.java
More file actions
33 lines (25 loc) · 946 Bytes
/
Copy pathTryCatchForm.java
File metadata and controls
33 lines (25 loc) · 946 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
import java.util.Scanner;
public class TryCatchForm{
public static void main(String[] args) {
System.out.println("*********EMPLOYEE REGISTRATION FORM********");
Scanner emp = new Scanner(System.in);
try{
System.out.println("first name of employee");
String firstname = emp.next();
System.out.println("enter last name of employee");
String lastname = emp.next();
}
catch (Exception e) {
System.out.println(e);}
try{
System.out.println("enter id of employee");
int id = emp.nextInt();
System.out.println("enter dob of employee");
int dob = emp.nextInt();
System.out.println("enter salary of employee");
int salary = emp.nextInt();
}
catch(Exception e){
System.out.println(e);}
}
}