1z0-809 Exam Question 86
Given:

and

Which interface from the java.util.functionpackage should you use to refactor the class Txt?

and

Which interface from the java.util.functionpackage should you use to refactor the class Txt?
1z0-809 Exam Question 87
Given the code fragment:

What is the result?

What is the result?
1z0-809 Exam Question 88
Given:
class UserException extends Exception { }
class AgeOutOfLimitException extends UserException { }
and the code fragment:
class App {
public void doRegister(String name, int age)
throws UserException, AgeOutOfLimitException {
if (name.length () <= 60) {
throw new UserException ();
} else if (age > 60) {
throw new AgeOutOfLimitException ();
} else {
System.out.println("User is registered.");
}
}
public static void main(String[ ] args) throws UserException {
App t = new App ();
t.doRegister("Mathew", 60);
}
}
What is the result?
class UserException extends Exception { }
class AgeOutOfLimitException extends UserException { }
and the code fragment:
class App {
public void doRegister(String name, int age)
throws UserException, AgeOutOfLimitException {
if (name.length () <= 60) {
throw new UserException ();
} else if (age > 60) {
throw new AgeOutOfLimitException ();
} else {
System.out.println("User is registered.");
}
}
public static void main(String[ ] args) throws UserException {
App t = new App ();
t.doRegister("Mathew", 60);
}
}
What is the result?
1z0-809 Exam Question 89
Given the code fragment:

What is the result?

What is the result?
1z0-809 Exam Question 90
Given the code fragment:
List<Integer> values = Arrays.asList (1, 2, 3);
values.stream ()
. map(n -> n*2) //line n1
. peek(System.out::print) //line n2
. count();
What is the result?
List<Integer> values = Arrays.asList (1, 2, 3);
values.stream ()
. map(n -> n*2) //line n1
. peek(System.out::print) //line n2
. count();
What is the result?