-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmp.java
More file actions
26 lines (20 loc) · 456 Bytes
/
Emp.java
File metadata and controls
26 lines (20 loc) · 456 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
package control;
public class Emp {
int id;
String name;
Address address;
public Emp(int id, String name, Address address) {
this.id = id;
this.name = name;
this.address = address;
}
@Override
public String toString() {
return id + " " + name + " " + address;
}
public static void main(String[] args) {
Address add1 = new Address("KTM", "Bagmati", "Nepal");
Emp emp1 = new Emp(111, "Sam", add1);
System.out.println(emp1);
}
}