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  

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

1 Expert Approved Answer
Step: 1 Unlock

public class Person private String name private int age private char gender Default ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!