-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemp_class.java
More file actions
43 lines (33 loc) · 856 Bytes
/
Copy pathemp_class.java
File metadata and controls
43 lines (33 loc) · 856 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
package workshop_java;
import java.util.*;
import java.io.*;
public class emp_class {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int id;
String name;
/*System.out.println("Enter Name =");
name=sc.nextLine();
System.out.println("Enter Id=");
id=sc.nextInt();*/
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
try
{
System.out.println("Enter Name =");
name=br.readLine();
System.out.println("Enter Id=");
id=Integer.parseInt(br.readLine());
Employee e2=new Employee(id,name);
System.out.println(e2);
}
catch(Exception e)
{
System.out.println(e);
}
Employee e1=new Employee();
e1.setEid(1);
e1.setName("Devanshi");
System.out.println(e1);
}
}