forked from eazybytes/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.java
More file actions
30 lines (24 loc) · 730 Bytes
/
Employee.java
File metadata and controls
30 lines (24 loc) · 730 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
public class Employee {
String firstName;
String lastName;
byte age;
char gender;
static final String EMPLOYER_NAME = "Google";
public Employee() {
this("Will", "Smith", (byte) 55, 'M');
System.out.println("Object is getting created in Default Constructor.....");
}
public Employee(String firstName, String lastName, byte age, char gender) {
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
this.gender = gender;
System.out.println("Object is getting created in overloaded Constructor.....");
}
public byte getAge( ) {
return age;
}
public char getGender( ) {
return gender;
}
}