Given the code fragment:

What is the result?
A. 2
B. 4
C. The program executes an infinite number of times.
D. 3
Given:

And the code fragment:

Which code fragment can be inserted at line n1 to enable the code to print All the best?
A. void writeMsg();
B. Messenger.writeMsg();
C. writeMsg();
D. m.writeMsg();
Given:

At which line does a compilation error occur?
A. line 5
B. line 2
C. line 3
D. line 7
Given the classes:

Which two modifications, independently, enable the Salad.java file to compile?
A. Replace line n1 with import fruits.Apple.getApple();
B. Replace line n1 with import fruits.Apple;
C. Replace line n1 with import fruits;
D. Replace line n2 with fruits.Apple apple = new Apple ();
E. Replace line n2 with fruits.Apple apple = new fruits.Apple ();

Which method identifier is correct according to Java naming conventions?
A. BillCalculator
B. calculateBill
C. calculatebill
D. Calculator

Given the code fragment:

What is the result?
A. 3 : 1
B. 3 : 2
C. 0 : 1
D. 2 : 0
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 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.