-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQues2.java
More file actions
28 lines (24 loc) · 723 Bytes
/
Ques2.java
File metadata and controls
28 lines (24 loc) · 723 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
import java.util.*;
class Employee {
String name;
int year;
String address;
Employee(String name, int year, String address) {
this.name = name;
this.year = year;
this.address = address;
}
public void print() {
System.out.println("Name: " + name + " Year: " + year + " Address: " + address);
}
}
class Ques2 {
public static void main(String args[]) {
Employee e1 = new Employee("Robert", 1994, "64C- WallsStreat");
Employee e2 = new Employee("Sam", 2000, "68D- WallsStreat");
Employee e3 = new Employee("John", 1999, "26B- WallsStreat");
e1.print();
e2.print();
e3.print();
}
}