Java OOP: Understanding Overriding & Hiding in Inheritance


Overview/Description
Expected Duration
Lesson Objectives
Course Number
Expertise Level



Overview/Description

In this course, you will learn about method overriding, including the use of the super keyword from contexts other than within constructions, and also examine the behavior of static methods. To start, participants learn how to apply method overriding and recognize the concept of hiding, and use the super keyword inside any method invocation in the derived class. This follows on to the use of advanced forms of overriding, combining method overriding with complex inheritance hierarchies. Study static methods and static binding, recognizing that static methods do not support run-time polymorphism. Examine pitfalls to avoid with static methods by learning to recognize how static methods are bound using compile-time rather than run-time binding. Learn how to correctly override the method .toString, which is inherited from java.lang.Object, and describe how the .equals method and the == operator are related. Explore how to correctly override the .hashCode method and write the code to correctly override the .equals method, inherited from java.lang.Object. Finally, after studying the link between equals and hashCode, discover how to implement the .hashCode contract.



Expected Duration (hours)
1.4

Lesson Objectives

Java OOP: Understanding Overriding & Hiding in Inheritance

  • discover the key concepts covered in this course
  • apply method overriding and recognize the concept of hiding
  • use the super keyword inside any method invocation in the derived class
  • use advanced forms of overriding
  • combine method overriding with fairly complex inheritance hierarchies
  • recognize that static methods don't support run-time polymorphism
  • recognize how static methods are bound using compile-time rather than run-time binding
  • override the method .toString, which is inherited from java.lang.Object
  • describe how the .equals method and the == operator are related
  • correctly override the .hashCode method and write the code to correctly override the .equals method, which is inherited from java.lang.Object
  • completely and correct implement the .hashCode contract
  • summarize the key concepts covered in this course
  • Course Number:
    it_jdoopjdj_05_enus

    Expertise Level
    Intermediate