
Identify two Java reserved words.
A. array
B. true
C. this
D. exception
E. string
Identify two features of Java.
A. architecture dependent
B. platform independent
C. single threaded
D. robust
Which statement is true about a mutator method?
A. It replaces the default constructor.
B. It returns mutated instance members.
C. It must be declared private.
D. It can be used to assign data to instance members.
Given the code fragment:

Which code fragment, when inserted at line n1, enables it to print Rita is 14 years old?
A. System.out.println("%s is %d years old" +name+age);
B. System.out.println("%s is %n years old" name, age);
C. System.out.printf("%s is %d years old", name, age);
D. System.out.printf("%s is %n years old", name, age);
Given:

What is the result?
A. A compilation error occurs in the modify method.
B. 99
C. 5
D. A compilation error occurs in the main method.
Given the code fragment: What is the result?

A. [jasmine, rose, lily]
B. A runtime exception is thrown.
C. [jasmine, lily, lotus]
D. [jasmine, rose, lotus, lily]

Given the code fragment:

What is the result?
A. 3 : 1
B. 3 : 2
C. 0 : 1
D. 2 : 0
Which two components can class declarations include?
A. A list of instance methods
B. The main method
C. Interfaces implemented by the class
D. The public modifier
Given the contents of the Test.java file:

What is the result?
A. 200 : 400
B. A compilation error occurs at line n1.
C. A compilation error occurs at line n2.
D. 100 : 400