Exam Questions

1:Which of the following is characteristic of a fully encapsulated class?
  1. All variables are private.

  2. All methods are private.

  3. Methods are provided to access the class's properties.

  4. The class's design can be changed with minimal impact on its implementation.

2:Which constructor creates a TextArea with 10 rows and 20 columns?
  1. new TextArea(10,20)

  2. new TextArea(20,10)

  3. new TextArea(new Rows(10), new Colums(20))

  4. new TextArea(200)

3:Which of the following are Java keywords?
  1. NULL

  2. null

  3. extends

  4. main

4:Which of the following are valid Java identifiers?
  1. %id

  2. $id

  3. _id

  4. #id

5:What is the value of y after execution of the following statements?
int x = 5;
int y = 4;
y = x++;
  1. 4

  2. 5

  3. 6

  4. 7

6:When the clipping region of a Graphics object is set, which of the following is true? ...

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams 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.