- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstructor.java
More file actions
Latest commit
41 lines (35 loc) · 864 Bytes
/
Copy pathconstructor.java
File metadata and controls
41 lines (35 loc) · 864 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
packagecom.company;
classMyMainEmployees{
privateintid;
privateStringname;
publicMyMainEmployees(intid, Stringname) {
this.id = id;
this.name = name;
}
// public MyMainEmployees() {
// this.id = 0;
// this.name = "Your-name-here";
// }
//
publicStringgetName() {
returnname;
}
publicvoidsetName(Stringname) {
this.name = name;
}
publicintgetId() {
returnid;
}
publicvoidsetId(intid) {
this.id = id;
}
}
publicclassconstructor {
publicstaticvoidmain(String[] args) {
MyMainEmployeesm1=newMyMainEmployees(32,"Rahul");
// m1.setId(12);
// m1.setName("Rahul");
System.out.println(m1.getId());
System.out.println(m1.getName());
}
}