Question: Create the Java class Person that has the following private attributes: name : String age: int gender : char a. Create a default constructor
Create the Java class Person that has the following private attributes: name : String age: int gender : char a. Create a default constructor that initializes all 3 attributes to the following values name age gender "unknown" 0 b. Create an overloaded constructor that takes in values for all 3 attributes and assigns them. c. Create getter and setter methods for all 3 attributes. d. Create the equals method. Two Person objects are equal when their age and gender are the same. (Disregard the names) e. Create the toString method so that it returns a well formatted String including all attributes.
Step by Step Solution
There are 3 Steps involved in it
public class Person private String name private int age private char gender Default ... View full answer
Get step-by-step solutions from verified subject matter experts
