Question: I need help with this java programming prompt: Prompt: Class name fname lname Class variable total Number Constructor (no arguments) Constructor (takes two arguments, fname


I need help with this java programming prompt:
Prompt:
Class name
fname
lname
Class variable
total Number
Constructor (no arguments)
Constructor (takes two arguments, fname and lname)
One getter method to return the fname and lname
One setter method for fname and lname
Inside Main:
Create three objects with the following names
Jill Doe
John James
Jack Smith
When creating the first object (Should not be an anonymous object)
use the argument-less constructor
Then use the setter method to assign the fname and lname
Then use the getter method to display the information for the first object
When creating the second object (Should not be an anonymous object)
use the two argument constructor to set the fname and lname
then use the getter method to display the information for the second object
When dealing with he third object (All of this should happen using one single statement)
Create an anonymous, third object using the two argument constructor. Use the getter method to retrieve fname and lname as a single string and then display the string. Remember that all of this code should be in a single statement.
Every time you add an abject increment total number by 1. This increment should only happen in the argument-less constructors tour. This means that if you call the two argument constructor, you have to revere to the argument-less constructor as well.
Before the end of the program, display the number of objects that were created by displaying the contents of totalNumber
Every time you add an object increment totalNumber by 1. This increment should onlY happen in the argument-less constructor. This means that if you call the two argument constructor, you have to refer to the argument-less constructor as well. Before the end of the program, display the number of objects that were created by displaying the contents of totalNumber. name class variable totalNumber constructor (no argument) constructor (takes two arguments, fname and Iname) One getter method to return the fname and lname as a single string One setter method for fname and Iname Inside main: Create three obiects with the following names Jill Doe John James Jack Smith When creating the first obiect (Should not be an anonymous object) use the argument-less constructor then use the setter method to assign the fname and Iname then use the getter method to display the information for the first object When creating the second object (Should not be an anonymous object) use the two argument constructor to set the fname and lname. then use the getter method to display the information for the second obiect When dealing with the third object (All of this should happen using one single statement) Create an anonymous, third object using the two argument constructor. Use the getter method to retrieve finame and Iname as a single string and then display the string. Remember that all of this code should be in a single statement. Every time you add an object increment totalNumber by 1. This increment should only happen in
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
