You have been asked to develop a Java program that prints the elements of an array in reverse order.
Which looping statement cannot be used to meet the requirement?
A. enhanced for
B. standard for
C. while
D. do-while
Given the code fragment:
Which code fragment can be inserted at line n1 to enable the code to compile?
A. new int num[];
B. int[] num;
C. int[10] num;
D. int num[10];
Given the code fragment:
What is the result?
A. Unknown issues. Invalid divisor.
B. Unknown issues.
C. Invalid divisor.
D. A compilation error occurs.
Identify two class variables.
A. private static int numberOfSquares = 20;
B. public static int counter = 0;
C. private Measure cm;
D. public int size = 10;
E. int scale = 35;
Given: Which statement, when inserted at line n1, enables the Course class to compile?
A. int newFee;
B. double newFee;
C. long newFee;
D. float newFee;
Given the code fragment:
What is the result?
A. false false
B. true true
C. true false
D. false true
What does import java.io* mean?
A. Only the io class is imported.
B. All classes in the io package are imported.
C. All classes whose names start with io are imported.
D. All classes in the io package and the subpackages of io packages, if any, are imported.
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