Answer is D,
public class Test {
public static void main (String[] args) {
final String str1 = "Java";
StringBuffer strBuf = new StringBuffer("Course");
UnaryOperator<String> u = (str2) -> str1.concat(str2);
UnaryOperator<String> c = (str3) -> str3.toLowerCase();
System.out.println(u.apply(strBuf));
}
}
Answer is D. The method apply(String) in the type Function<String,String> is not applicable for the arguments (StringBuffer). c.appy(strBuff) is not correct.
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.
asdfjhfgjuaDCV
4 months, 3 weeks agosteefaand
5 months, 3 weeks agoHanenBA
2 years, 5 months agoTarik2190
3 years, 2 months agoSvetleto13
3 years, 2 months agohmcbq
3 years, 3 months agojduarte
3 years, 3 months agopul26
3 years, 7 months ago