exam questions

Exam 1z0-809 All Questions

View all questions & answers for the 1z0-809 exam

Exam 1z0-809 topic 1 question 101 discussion

Actual exam question from Oracle's 1z0-809
Question #: 101
Topic #: 1
[All 1z0-809 Questions]

Given the code fragment:

What is the result?

  • A. A compilation error occurs at line n1.
  • B. courseJava
  • C. Javacourse
  • D. A compilation error occurs at line n2.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
asdfjhfgjuaDCV
4 months, 3 weeks ago
D is the correct answer
upvoted 1 times
...
steefaand
5 months, 3 weeks ago
Selected Answer: D
Answer is D. UnaryOperator takes a String and not StringBuffer.
upvoted 1 times
...
HanenBA
2 years, 5 months ago
Selected Answer: D
UnaryOperator<String> c accept a string as input not StringBuffer, so c.apply(strBuf) will cause a compilation error
upvoted 3 times
...
Tarik2190
3 years, 2 months ago
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)); } }
upvoted 3 times
...
Svetleto13
3 years, 2 months ago
D,tested
upvoted 2 times
...
hmcbq
3 years, 3 months ago
Answer is A. If lambda has parenthesis than parameter should be with type.
upvoted 1 times
...
jduarte
3 years, 3 months ago
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.
upvoted 4 times
...
pul26
3 years, 7 months ago
Answer is D strBuf is not a String
upvoted 3 times
...
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago