This code doesn't compiled
"T is not found"
it will compile if written something like this
public static <T extends Integer> void printValue(Function f, T num) {
There is no correct answer
This code, for example, remove the compile warning :
public static void main(String[] args) {
Function <Integer, Integer> triple = x -> {
return x*3;
};
MyClass.printValue(triple, 4);
}
public static void printValue(Function<Integer, Integer> f, int num) {
System.out.println(f.apply(num));
}
"T is not found"
use bounded type parameters like <T extends Integer>
or change T to Integer or int (A,D)
"...uses unchecked or unsafe operations."
the reason is using raw code
use generics
Function<Integer, Integer>
This section is not available anymore. Please use the main Exam Page.1z0-819 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ASPushkin
1 year agoASPushkin
7 months, 2 weeks agodilleman
1 year, 8 months agoStavok
1 year, 11 months ago