equals()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kirthu4u
    New Member
    • Nov 2007
    • 2

    #1

    equals()

    Write a simple base class with at least two attributes and associated setter and getter methods. Define an equals() for this base class. Ensure that your equals() method satisfies the equals contract. Next write a simple class that extends your base class and which has at least one new attribute with associated setters and getters. Write an equals() method for this new class. Ensure that this satisfies the equals contract.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by kirthu4u
    Write a simple base class with at least two attributes and associated setter and getter methods. Define an equals() for this base class. Ensure that your equals() method satisfies the equals contract. Next write a simple class that extends your base class and which has at least one new attribute with associated setters and getters. Write an equals() method for this new class. Ensure that this satisfies the equals contract.
    You are in luck.
    There's an article in the Java articles section which explains all that you have described above ... and more.

    Comment

    Working...