Object Concepts and Terminology-2

Superclasses subclasses and polymorphism access

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: IntroducDon to Inheritance The Object Class The parent class of all objects is the Object class. Methods of the Object class: •  toString( ) Returns a String object containing the class name •  equals( ) Returns true if two objects occupy the same memory space •  getClass( ) Returns a Class object of the same type •  clone( ) Returns a copy of this object •  hashCode( ) Returns the hashcode for this object •  finalize( ) Called by the garbage collector when no more references exist. Superclasses, Subclasses, and Polymorphism Access Modifiers Type •  public •  private •  protected •  package (default) Purpose Available everywhere Available within the current class only Available within the current...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online