Class Human

java.lang.Object
collection.City.Human
All Implemented Interfaces:
Comparable<Human>

public class Human extends Object implements Comparable<Human>
Class representing a human
  • Constructor Details

    • Human

      public Human(String name)
    • Human

      public Human()
  • Method Details

    • getName

      public String getName()
    • setName

      public void setName(String name)
    • compareTo

      public int compareTo(Human o)
      Compares two Human objects by their names
      Specified by:
      compareTo in interface Comparable<Human>
      Parameters:
      o - - Human object to compare
      Returns:
      - negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
    • toString

      public String toString()
      Overrides:
      toString in class Object