Question: In Java You are going to design (and code) a class called Name. The class Name will contain three properties: first, the first name which

In Java
You are going to design (and code) a class called Name. The class Name will contain three properties:
first, the first name which is a String
initial, the middle initial, which is a single character.
last, the last name, which is a String
The class has three constructors:
A default constructor, which accepts no parameters, calls constructors for the first and last name and sets the initial equal to a blank space.
Two conversion constructors, one of which accepts two parameters (first and last name), the other accepting three parameters (first name, middle initial and last name). The constructor accepting two paraeters sets the middle initial equal to a blank space.
In addition to the constructors, the Name class has the following methods:
readName() - which prompts the user for first name, middle initial and last name and reads them in.
writeName() - which prints the first name, middle initial and last name with a blank separating them, but without a newline (Use System.out.print().)
equals(), which returns true if the names are the same, false otherwise (case should match as well).
Write another class complete with a main()that uses the new class that you wrote and demonstrates that these methods all work correctly.
Use scanner as default constructors
It should compare 2different objects

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!