-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathch9cons.java
More file actions
44 lines (33 loc) · 801 Bytes
/
Copy pathch9cons.java
File metadata and controls
44 lines (33 loc) · 801 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
class myMainEmployee{
private int id;
private String name;
myMainEmployee()
{
System.out.println(" Angel ");
id = 45;
name = "chandresh";
}
myMainEmployee(String myname){
name = myname;
}
public void setId(int i){
id = i;
}
public int getId(){
return id;
}
public void setName(String n){
name = n;
}
public String getName(){
return name;
}
}
class ch9cons{
public static void main(String [] args){
myMainEmployee harry= new myMainEmployee();
myMainEmployee harry1 = new myMainEmployee("Nidhi");
System.out.println(harry.getId());
System.out.println(harry.getName());
}
}