-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemo.java
More file actions
34 lines (22 loc) · 726 Bytes
/
Copy pathDemo.java
File metadata and controls
34 lines (22 loc) · 726 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
public class Employee {
String name,city;
int age;
Employee(String n,String c,int a){
name = n;
city = c;
age = a;
}
void display(){
System.out.println("The age is"+" "+age);
System.out.println("The name is"+" "+name);
System.out.println("The city is"+" "+city);
}
public static void main(String arg[]){
Employee e1 = new Employee("Anchal","kolkata",12);
Employee e2 = new Employee("Anika","Bihar",19);
System.out.print("employee 1"+"\n");
e1.display();
System.out.print("\n"+"employee 2"+"\n");
e2.display();
}
}