Create a base class called Vehicle that has the manufacturer's name (type String), number of cylinders in
Question:
Listing 8.1
Person Class
public class Person
{
String name;
public Person( )
{
name = "No name yet";
}
public Person(String initialName)
{
name = initialName;
}
public void setName(String newName)
{
name = newName;
}
public String getName( )
{
return name;
}
public void writeOutput( )
{
System.out.println("Name: " + name);
}
public boolean hasSameName(Person otherPerson)
{
return this.name.equalsIgnoreCase(otherPerson.name);
}
}
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Question Posted: