Question: java program I.AB. Create a project named labExamCCCS221 containing following elass: 1. numberOfPersons is incremented when a person is ereated. 2. The first constructor does
I.AB. Create a project named labExamCCCS221 containing following elass: 1. numberOfPersons is incremented when a person is ereated. 2. The first constructor does nothing. 3. The second constructor initializes the id and the name. 4. The setName method sets the person's name. 5. The setld method sets the new Id if the new id is greater than 0 . 6. The getnumberOfersons method returns the values of aumberORersons. 7. The tostring method returns the description of the person (ld and name). 8. Add to the class Person the method main in which: a. Create an object P1 with the first constructor. b. Create an object P2 with the c. Set the id of 1 to 10000 persons e. Display all information of P
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
