Skip to content

Instantly share code, notes, and snippets.

@anupamhaldkar
Created July 18, 2020 09:30
Show Gist options
  • Save anupamhaldkar/a5812f154e9e83ecb9f3be32b753b778 to your computer and use it in GitHub Desktop.
Save anupamhaldkar/a5812f154e9e83ecb9f3be32b753b778 to your computer and use it in GitHub Desktop.
// 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