Free 1Z0-809 Exam Dumps

Question 11

Given the code fragment:
List nums = Arrays.asList (10, 20, 8): System.out.println (
//line n1
);
Which code fragment must be inserted at line n1 to enable the code to print the maximum number in the nums list?

Correct Answer:A

Question 12

Given the code fragment:
1Z0-809 dumps exhibit
What is the result ?

Correct Answer:A

Question 13

Given the code fragment:
List empDetails = Arrays.asList(“100, Robin, HR”, “200, Mary, AdminServices”,
“101, Peter, HR”);
empDetails.stream()
.filter(s-> s.contains(“1”))
.sorted()
.f orEach(System.out::println); //line n1
What is the result?

Correct Answer:A

Question 14

Given the code fragments:
4. void doStuff() throws ArithmeticException, NumberFormatException, Exception
{
5. if (Math.random() >-1 throw new Exception (“Try again”); 6. }
and
24. try {
25. doStuff ( ):
26. } catch (ArithmeticException | NumberFormatException | Exception e) {
27. System.out.println (e.getMessage()); }
28. catch (Exception e) {
29. System.out.println (e.getMessage()); }
30. }
Which modification enables the code to print Try again?

Correct Answer:C

Question 15

Given:
class FuelNotAvailException extends Exception { } class Vehicle {
void ride() throws FuelNotAvailException { //line n1 System.out.println(“Happy Journey!”);
}
}
class SolarVehicle extends Vehicle {
public void ride () throws Exception { //line n2 super ride ();
}
}
and the code fragment:
public static void main (String[] args) throws FuelNotAvailException, Exception
{
Vehicle v = new SolarVehicle (); v.ride();
}
Which modification enables the code fragment to print Happy Journey!?

Correct Answer:B