Given:
Why does D cause a compilation error?
A. D inherits a() only from C.
B. D inherits a() from B and C but the return types are incompatible.
C. D extends more than one interface.
D. D does not define any method.
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.
Given:
Which two method implementations are correct, when inserted independently in line 1? (Choose two.)
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Given:
var data = new ArrayList<>();
data.add("Peter");
data.add(30);
data.add("Market Road");
data.set(1, 25);
data.remove(2);
data.set(3, 1000L);
System.out.print(data);
What is the output?
A. [Market Road, 1000]
B. [Peter, 30, Market Road]
C. [Peter, 25, null, 1000]
D. An exception is thrown at run time.
Given:
What code must you insert on Line 1 to enable the code to print Hello world?
A. Hello.Greeting myG = new Hello.Greeting() myG.sayHi();
B. Hello myH = new Hello(); Hello.Greeting myG = myH.new Greeting(); myG.sayHi();
C. Hello myH = new Hello(); Hello.Greeting myG = myH.new Hello.Greeting(); myG.sayHi();
D. Hello myH = new Hello(); Greeting myG = new Greeting(); myG.sayHi ();
Given the code fragment:
Which two code fragments, independently, replace line 1 to implement the equivalent reduce operation? (Choose two.)
A. Integer sum = data.map(a -> a).reduce((a, b) -> a+b);
B. OptionalInt value = data.mapToInt(a -> a).parallel().reduce(0, (a, b) -> a+b); Integer sum = value.getAsInt();
C. int s = 0; Integer sum = data.map(a -> a).reduce(0, (a-> a + s));
D. OptionalInt value = data.mapToInt(a -> a).parallel().reduce((a, b) -> a+b); Integer sum = value.getAsInt();
E. Integer sum = data.mapToInt(a -> a).reduce(0, (a,b)->a+b));
Given:
What is the result?
A. X is 2
B. The compilation fails due to an error in line 1
C. The compilation fails due to an error in line 2
D. Error parsing value 0
E. X is 10
Given:
Which three statements cause a compiler error when inserted at line l? (Choose three.)
A. int i = theInstance.three++;
B. int b = two;
C. int c = three;
D. int a = one++;
E. int f = ExampleInterface.three;
F. int h = theInstance.two;
G. int e = ExampleInterface.two++;
H. int a = ExampleInterface.one;
I. int g = theInstance.one;
Given:
Which two code fragments remove the elements from the original list? (Choose two.)
A. Option A
B. Option B
C. Option C
D. Option D