Which code fragment must be inserted at line 6 to enable the code to compile?
A.
DBConfiguration f;
return f;
B. return DBConfiguration;
C. return new DBConfiguration();
D. retutn 0;
What is the result?
A. Number us : 12345
B. A NullPointerException is thrown at runtime
C. A NumberFormatException is thrown at runtime
D. An ArrayIndexOutOfBoundException is thrown at runtime.
What is the result?
A. 2 4 6 8 10 12
B. 2 4 6 8 10 12 14
C. Compilation fails
D. The program prints multiple of 2 infinite times
E. The program prints nothing
Which two are benefits of polymorphism?
A. Faster code at runtime
B. More efficient code at runtime
C. More dynamic code at runtime
D. More flexible and reusable code
E. Code that is protected from e...
What is the result?
A. message = Hi everyone!
B. message = Hi XvXryonX!
C. A compile time error is produced.
D. A runtime error is produced.
E. message =
F. message = Hi Xveryone!
Which code fragment, when inserted at line 7, enables the code print true?
A.
while(key == myarray[index++]){
isFound = true;
}
B.
while(index <= 4){
if(){
index++;
isFound = ...
Which three statements are benefits of encapsulation?
A. Allows a class implementation to change without changing the clients
B. Protects confidential data from leaking out of the objects
C. Prevents...
What is the result?
A. 10 8 6 4 2 0
B. 10 8 6 4 2
C. AnArithmeticException is thrown at runtime
D. The program goes into an infinite loop outputting: 10 8 6 4 2 0. . .
E. Compilation fails
What is the result?
A. The program prints nothing
B. d
C. A StringIndexOutOfBoundsException is thrown at runtime.
D. An ArrayIndexOutOfBoundsException is thrown at runtime.
E. A NullPointerException ...