JAVA PROGRAMMING - Create a class named Person that has the attributes: First name - String Last name - String Gender - String Age - Integer Address - String - Create two constructors: one that accepts the first name and the last name only and one that accepts all attributes. Accept inputs for all attributes and create two subjects that use each constructor. Print their attributes. Inputs: 1. Enter first name 2. Enter last name 3. Enter gender 4. Enter age 5. Enter address Output: Enter first name: John Enter last name: Doe Enter gender: Male Enter age: 19 Enter address: JDoe Object 1 First Name: John Last name: Doe Gender: Age: Address: Object 2 First Name: John Last name: Doe Gender: Male Age: 19 Address: JDoe
JAVA PROGRAMMING - Create a class named Person that has the attributes: First name - String Last name - String Gender - String Age - Integer Address - String - Create two constructors: one that accepts the first name and the last name only and one that accepts all attributes. Accept inputs for all attributes and create two subjects that use each constructor. Print their attributes. Inputs: 1. Enter first name 2. Enter last name 3. Enter gender 4. Enter age 5. Enter address Output: Enter first name: John Enter last name: Doe Enter gender: Male Enter age: 19 Enter address: JDoe Object 1 First Name: John Last name: Doe Gender: Age: Address: Object 2 First Name: John Last name: Doe Gender: Male Age: 19 Address: JDoe
Step by step
Solved in 3 steps with 1 images