Oracle
1Z0-850 · Question #62
Given: 1. // insert code here 2. void play(); 3. void stop(); 4. 5. // insert code here 6. public void play() { } 7. public void stop() { } 8. } Which, inserted at lines 1 and 5, allows the code to…
The correct answer is A. 1. interface Player { 5. class DVDPlayer implements Player {. See the full explanation below for the reasoning.
Question
Given:
- // insert code here
- void play();
- void stop();
- // insert code here
- public void play() { }
- public void stop() { }
- } Which, inserted at lines 1 and 5, allows the code to compile?
Options
- A
- interface Player { 5. class DVDPlayer implements Player {
- B
- implements Player { 5. class DVDPlayer interface Player {
- C
- abstract class Player { 5. class DVDPlayer extends Player {
- D
- interface Player { 5. class DVDPlayer extends Player {
- E
- class Player { 5. interface DVDPlayer implements Player {
How the community answered
(25 responses)- A76% (19)
- B4% (1)
- C12% (3)
- D4% (1)
- E4% (1)
Community Discussion
No community discussion yet for this question.