exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 135 discussion

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

Which class definition compiles?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: B

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
richotaru
Highly Voted 3 years, 4 months ago
The Correct Answer is B D only compiles when "public" is added to "void move()" in the definition of the anonymous class
upvoted 12 times
...
steefaand
Most Recent 5 months, 4 weeks ago
B is correct. Tested. A doesn't compile because method class can't be public, C doesn't compile because you can't reference non-static members from static context and D doesn't compile because move method must be public.
upvoted 1 times
...
Ohayou
2 years, 4 months ago
Answer : B
upvoted 1 times
...
WilsonKKerll
2 years, 4 months ago
Answer is B.
upvoted 1 times
...
Samriddji
2 years, 8 months ago
B, tested
upvoted 1 times
...
laura_lu93
3 years, 5 months ago
I don't know how this is possible but B and D both compile... I tested
upvoted 4 times
...
pul26
3 years, 7 months ago
Answer is D, tested class Vehicle{ int id; public void start(){ // compile error public class Engine{ int eNo = id;} } } class Computer{ // compile error private Card card = new SoundCard(); private abstract class Card{} // compile error private class SoundCard extends Card{} } class Block{ int bno; static class Counter{ int locator; //compile error Counter(){ locator = bno;} } } class Product{ interface Moveable{void move();} Moveable m = new Moveable() { @Override public void move() { } }; }
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