Created
July 18, 2020 09:30
-
-
Save anupamhaldkar/a5812f154e9e83ecb9f3be32b753b778 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Employee POJO class to represent Employee entity | |
public class Employee | |
{ | |
// private field | |
private String name; | |
// public field | |
public String id; | |
// default salary | |
double salary; | |
//arg-constructor to initialize fields | |
public Employee(String name, String id, | |
double salary) | |
{ | |
this.name = name; | |
this.id = id; | |
this.salary = salary; | |
} | |
// getter method for name | |
public String getName() | |
{ | |
return name; | |
} | |
// getter method for id | |
public String getId() | |
{ | |
return id; | |
} | |
// getter method for salary | |
public Double getSalary() | |
{ | |
return salary; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment