Answered step by step
Verified Expert Solution
Question
1 Approved Answer
public class Person { private static int lastId = 1 0 0 0 ; private String firstName; private String lastName; private int id; public Person
public class Person
private static int lastId ;
private String firstName;
private String lastName;
private int id;
public PersonString firstName, String lastName
this.firstName firstName;
this.lastName lastName;
this.id lastId;
public String getFirstName
return firstName;
public String getLastName
return lastName;
public String getFullName
return firstName lastName;
public int getId
return id;
public void printFirstName
System.out.printlnFirst Name: firstName;
public void printLastName
System.out.printlnLast Name: lastName;
public void printId
System.out.printlnID: id;
@Override
public String toString
return "Person id id firstName firstName lastName lastName ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started