exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 148 discussion

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

Given the code fragments:
and

What is the result?

  • A. null
  • B. A compilation error occurs.
  • C. DogCatMouse
  • D. [Dog, Cat, Mouse]
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
DarGrin
1 week, 3 days ago
Answer B. Method printValues() should take a String and be public like this: public static void printValues(String s) {System.out.println(s);}
upvoted 1 times
DarGrin
1 week, 3 days ago
Sorry, and be static
upvoted 1 times
...
...
steefaand
4 months, 1 week ago
Selected Answer: B
B is correct.
upvoted 1 times
...
r1muka5
1 year, 2 months ago
Selected Answer: B
Actual answer is B because the method should be static
upvoted 1 times
...
jduarte
3 years, 4 months ago
Answer B. Tested . t.getList().forEach(Test::printValues) Multiple markers at this line - The type Test does not define printValues(String) that is applicable here - The method forEach(Consumer<? super String>) in the type Iterable<String> is not applicable for the arguments (Test1::printValues)
upvoted 4 times
...
ayzo
3 years, 4 months ago
true B
upvoted 3 times
...
sansay61
3 years, 5 months ago
B- compilation error. printvalues must be static
upvoted 4 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