Given the code fragment: What is the result?
A. -1 : 2
B. 2 : -1
C. 2 : 3
D. 3 : 0
Given:
Which two lines of code when inserted in line 1 correctly modifies instance variables? (Choose two.)
A. setCCount(c) = cCount;
B. tCount = tCount;
C. setGCount(g);
D. cCount = setCCount(c);
E. aCount = a;
Given:
Which is true?
A. The compilation fails due to an error in line 6.
B. The compilation succeeds.
C. The compilation fails due to an error in line 4.
D. The compilation fails due to an error in line 10.
E. The compilation fails due to an error in line 7.
F. The compilation fails due to an error in line 9.
G. The compilation fails due to an error in line 2.
Given:
What is the result?
A. A ClassCastException is thrown at runtime.
B. AnotherClass#methodA() AnotherClass#methodA()
C. The compilation fails.
D. SomeClass#methodA() AnotherClass#methodA()
E. AnotherClass#methodA() SomeClass#methodA()
F. SomeClass#methodA() SomeClass#methodA()
Given: What is the result?
A. is it 1
B. An IndexOutOfBoundsException is thrown at runtime.
C. is it 0
D. this is it 2
E. this is it 3
Given the code fragment:
What is the result?
A. 0
B. 0
C. 1
D. The program prints nothing.
E. It prints 1 in the infinite loop.
Given:
Assuming that this code compiles correctly, which three statements are true? (Choose three.)
A. B cannot be abstract.
B. B is a subtype of A.
C. A cannot be abstract.
D. A cannot be final.
E. B cannot be final.
F. A is a subtype of B.
Given:
What is the result?
A. null
B. Joe Bloggs
C. The compilation fails due to an error in line 1.
D. p1
Given:
Automobile.java
Car.java
What must you do so that the code prints 4?
A. Remove the parameter from wheels method in line 3.
B. Add @Override annotation in line 2.
C. Replace the code in line 2 with Car ob = new Car();
D. Remove abstract keyword in line 1.
What makes Java dynamic?
A. At runtime, classes are loaded as needed, and new code modules can be loaded on demand.
B. The runtime can process machine language sources as well as executables from different language compilers.
C. The Java compiler uses reflection to test if class methods are supported by resources of a target platform.
D. The Java compiler preprocesses classes to run on specific target platforms.