Person - public String getName () { return name; } public...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/** HW #2, Problem #3 */ public class Person // for problem 3 {     private String name;     public Person ()     {         name = "No name yet";     }     public Person (String initialName)     {         name = initialName;     }     public void setName (String newName)     {         name = newName;     }
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public String getName () { return name; } public void writeOutput () { System.out.println ("Name: " + name); } public boolean hasSameName (Person otherPerson) { return this.name.equalsIgnoreCase (otherPerson.name); } }...
View Full Document

This note was uploaded on 09/28/2011 for the course CS 2133 taught by Professor Rao during the Fall '10 term at Oklahoma State.

Ask a homework question - tutors are online