Chapter 7Working with Inheritance

THE OCA EXAM TOPICS COVERED IN THIS PRACTICE TEST INCLUDE THE FOLLOWING:

  • Working with Inheritance
    • Describe inheritance and its benefits
    • Develop code that makes use of polymorphism; develop code that overrides methods; differentiate between the type of a reference and the type of an object
    • Determine when casting is necessary
    • Use super and this to access objects and constructors
    • Use abstract classes and interfaces
  1. How many lines of the following program contain compilation errors?

    package theater;
    class Cinema {
       private String name;
       public Cinema(String name) {this.name = name;}
    }
    public class Movie ...

Get OCA / OCP Java SE 8 Programmer Practice Tests now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.