-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustomclass.java
More file actions
48 lines (32 loc) · 937 Bytes
/
Copy pathcustomclass.java
File metadata and controls
48 lines (32 loc) · 937 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
45
46
47
48
class Employee{
int id;
int salary;
String name;
public void getDetails(){
System.out.println("my id is "+id);
System.out.println("my name is "+name);
}
public int getSalary(){
return salary;
}
}
public class customclass{
public static void main(String [] args){
Employee harry = new Employee();
Employee chandresh = new Employee();
harry.id = 1;
harry.salary = 20000;
harry.name = "harry";
chandresh.id = 2;
chandresh.salary = 300000;
chandresh.name= "chandresh rathod";
harry.getDetails();
chandresh.getDetails();
int Salary = harry.getSalary();
int valary = chandresh.getSalary();
System.out.println(Salary);
System.out.println(valary);
harry.getSalary();
chandresh.getSalary();
}
}