O'Reilly logo

OCA Java SE 7 Programmer Study Guide (Exam 1Z0-803) by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B

Mock Exam Answers

The following are answers to the questions in the mock exam in Appendix A.

Question 1 (7.1. Implement inheritance)

The keyword extends can be used

A. to create a subclass from another class

B. to create a subinterface from another interface

C. to make a class implement an interface

D. to make an interface implement another interface

Answer: A, B.

The keyword extends can be used to create a child class from another class or a subinterface from another interface. C is incorrect because extends cannot be used to make a class implement an interface. For this, you use the keyword implements. Also in Java an interface cannot implement another interface, so D is incorrect.

Question 2 (6.4. Differentiate between default ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required