First create model class named Person having getter and setters. public class Persons {
int age;
double salary;
String name;
String city;
public Persons() {
super();
// TODO Auto-generated constructor stub
}
public Persons(int age, double salary, String name, String city) {
super();
this.age = age;
this.salary = salary;
this.name = name;
this.city = city;
}
@Override
public String toString()…