-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.java
More file actions
35 lines (31 loc) · 926 Bytes
/
Copy pathEmployee.java
File metadata and controls
35 lines (31 loc) · 926 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
public class Employee {
String name;
int yoj;
float salary;
String add;
void getdata(String n, int y, float s, String a) {
name = n;
yoj = y;
salary = s;
add = a;
}
void print() {
System.out.println("Name \t Year of Joining \t Salary \t Address");
System.out.println("------------------------------------------------------");
}
void printdata() {
System.out.println(" " + name + " \t " + yoj + " \t " + salary + " \t " + add);
}
}
class Qs8 {
public static void main(String[] rds) {
Employee em = new Employee();
em.print();
em.getdata("Akash", 2018, 30000, "Hooghly");
em.printdata();
em.getdata("Arghajit", 2019, 40000, "Nadia");
em.printdata();
em.getdata("Bidyut", 2018, 35000, "Kolkata");
em.printdata();
}
}