Exam Prep Practice Questions

Question 1
Which of the following class declarations use modifier keywords incorrectly? [Check all correct answers.]
  • A. public synchronized class FastClass extends Thread

  • B. private protected class FastClass

  • C. public abstract class FastClass

  • D. class FastClass extends Thread

A1: Answers A and B are correct. The synchronized, protected, and private keywords cannot be applied to classes. Answer C is incorrect because the usage is proper; the abstract keyword indicates that there is at least one abstract method in the class. ...

Get Java 2™ Programmer Exam Cram™ 2 (Exam CX-310-035) 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.