public class Person {
private String name;
private int age;
// Default constructor
public Person() {
}
// Constructor with parameters
public Person(String name, int age) {
this.name = name;
this.age = age;
}
// Getter for name
public String getName() {
return name;
}
// Setter for name
public void setName(String name) {
this.name = name;
}
// Getter for age
public int getAge() {
return age;
}
// Setter for age
public void setAge(int age) {
this.age = age;
}
POJO Practice • 1 min read
Description
learning/testing code!