Review OOP concepts

  • A class, is like a definition of a data type in Java

  • An instance of an object of a given class is created (= instantiated) using a constructor and the new operator.

  • Object instances in Java are accessed through reference variables.

  • A subclass can extend a superclass and use its methods and instance variables through inheritance and polymorphism.

  • Abstract classes can contain 0 or more abstract methods

    Classes containing at least one abstract method must be abstract

    Abstract classes can not be used to instantiate objects

    Abstract classes are extended by a subclass that defines the abstract methods.

  • Interfaces contain only abstract methods and constants and provides a template for another class to implement all of the methods declared in the interface.