8.2. Answers to mock exam questions

This section contains answers to all the mock exam questions in section 8.1. Also, each question is preceded by the exam objective that the question is based on.

[7.3] Differentiate between the type of a reference and the type of an object

ME-Q1.

Given the following definition of the classes Animal, Lion, and Jumpable, select the correct combinations of assignments of a variable (select 2 options):

interface Jumpable {}
class Animal {}
class Lion extends Animal implements Jumpable {}
a Jumpable var1 = new Jumpable();
b Animal var2 = new Animal();
c Lion var3 = new Animal(); ...

Get OCA Java SE 7 Programmer I Certification Guide 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.