Question: java Write a class called Person which has three private attributes, name of type string, id of type long, and job of type string. The
Write a class called Person which has three private attributes, name of type string, id of type long, and job of type string. The class has two constructors one without parameters and the other is with parameters for all the attributes. The initial values for the attributes should be o for id, "unknown" for name and "unknown" for job. The id can only be accepted if it is greater than 0 and less than 999999999 and should contain 9 digits, otherwise, the initial value for the id should be 111111111 The class has get and set methods for every attribute. 1 The class also has one method called print which prints id, name and job. Write a class called PersonApp which contains the main method. In the main, create two objects of class Person. Use set, get and print methods in your main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
