Representing Names

  1. Write a class Name that stores a person's first, middle, and last names and provides the following methods:

  2. Now write a program TestNames.java that prompts for and reads in two names from the user (you'll need first, middle, and last for each), creates a Name object for each, and uses the methods of the Name class to do the following:
    1. For each name, print
      • first-middle-last version
      • last-first-middle version
      • initials
      • length
    2. Tell whether or not the names are the same.

     

    Had enough java for now?

~Lab 1 over~

Go back to lab1 index page