Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setters usage example
class Person {
private int age;
private String firstName;
private String lastName;
// getters and setters...
}
Person employee = new Person();
employee.setAge(25);
employee.setFirstName("Michael");
employee.setLastName("Brown");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment