Given the code fragment:
What is the result?
A. pen pencil erasers paper
B. paper pen pencil erasers
C. A compilation error occurs.
D. A runtime exception is thrown.
Given:
What is the result?
A. [null:-]
B. [ : ]
C. [null:null]
D. [:null]
Which two Java reserved words are used to implement encapsulation?
A. final
B. static
C. public
D. extends
E. private
Which two statements are true about the Java Runtime Environment (JRE)?
A. It is responsible for garbage collection.
B. It interprets bytecode stored in a .class file.
C. It contains the JDK and Java APIs.
D. It is platform independent.
E. You must install the JRE to compile a .java file.
Given the code fragment: What is the result?
A. Selected null flavor.
B. Selected Chocolate flavor.
C. An ArrayIndexOutofBoundsException is thrown at run time.
D. Selected Chocolate flavor. Thank you!
Given the code fragment:
What is the result?
A. false false false false
B. true false false false
C. true true true true
D. true true true false
Given the code fragment:
Which statement is true?
A. A compilation error occurs at line 5.
B. A compilation error occurs at line 3.
C. The code compiles without errors.
D. A compilation error occurs at line 7.
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:
What is the result?
A. Compilation fails. To make it compile, replace line n1 with var1 = 0;
B. Compilation fails. To make it compile, replace line n2 with var2 = 0;
C. 0
D. Nothing is printed.
Given the code fragment:
What is the result?
A. 25.67
B. 25.00
C. 25.7
D. 26
Given the code fragment: What is the result?
A. false true
B. true true
C. false false
D. A runtime exception is thrown
Given the code fragment:
What is the result?
A. A compilation error occurs at line n1.
B. Jack
C. The program prints either Jack or Queen.
D. Queen
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:
What is the output?
A. 1 2 3 aaaa
B. 1 2 aaa
C. Compilation fails
D. a
Given:
What is the result?
A. The program compiles and nothing is printed.
B. Iteration plus an increasing number is printed 100 times.
C. Iteration plus an increasing number is printed 99 times.
D. An error occurs during compilation.