Given:
and the code fragment:
What is the result?
Correct Answer:
B
Given the code fragment:
List
String fmt = codes.stream()
.filter (s-> s.contains (“PEG”))
.r educe((s, t) -> s + t).get(); System.out.println(“n” + fmt); What is the result?
Correct Answer:
A
Which code fragment is required to load a JDBC 3.0 driver?
Correct Answer:
B
Given:
public final class IceCream { public void prepare() {}
}
public class Cake {
public final void bake(int min, int temp) {} public void mix() {}
}
public class Shop {
private Cake c = new Cake (); private final double discount = 0.25;
public void makeReady () { c.bake(10, 120); }
}
public class Bread extends Cake {
public void bake(int minutes, int temperature) {} public void addToppings() {}
}
Which statement is true?
Correct Answer:
D
Given the code fragment:
What is the result?
Correct Answer:
A