Java OOP: Interfaces & Anonymous Classes


Overview/Description
Expected Duration
Lesson Objectives
Course Number
Expertise Level



Overview/Description

In this course, you will focus on one of the most important concepts in all object-oriented programming for Java, the interface. Learners explore how anonymous inner classes provide lightweight instantiations of interfaces, and how interfaces are pure abstract entities. Begin with an introduction into using interfaces and how all their methods are abstract by default. Examine how the instanceof operator works the same way with interfaces as with classes. This leads on to combining the extends and implements keywords: implementing a derived class that can extend a base class and implement an interface. Then learners learn to set up two inheritance hierarchies and combine these into a set of objects that implement both sets of interfaces. Advanced features of interfaces are also examined. Learn how interfaces can support default method implementations. You will set up a class that implements some of the methods of an interface and declares itself abstract. Finally, you will create and define anonymous inner class objects and access outer class variables from your anonymous inner class.



Expected Duration (hours)
1.1

Lesson Objectives

Java OOP: Interfaces & Anonymous Classes

  • discover the key concepts covered in this course
  • use interfaces and recognized that all of their methods are abstract by default
  • recognize how the instanceof operator works the same way with interfaces as with classes
  • implement a derived class that can both extend a base class and implement an interface
  • set up two inheritance hierarchies and combine these into a set of objects that implement both set of interfaces
  • use interfaces that support default method implementations
  • set up a class that implements some of the methods of an interface and then declares itself abstract
  • create and define anonymous inner class objects
  • access outer class variables from your anonymous inner class
  • summarize the key concepts covered in this course
  • Course Number:
    it_jdoopjdj_08_enus

    Expertise Level
    Intermediate