Oracle
1Z0-850 · Question #31
Given: 1. public abstract class Wow { 2. private int wow; 3. public Wow(int wow) { 4. this.wow = wow; 5. } 6. public void wow() { } 7. private void wowza() { } 8. } Which is true about the class Wow?
The correct answer is C. It compiles without error. See the full explanation below for the reasoning.
Question
Given:
- public abstract class Wow {
- private int wow;
- public Wow(int wow) {
- this.wow = wow;
- }
- public void wow() { }
- private void wowza() { }
- } Which is true about the class Wow?
Options
- AIt does NOT compile because an abstract class must have at least one abstract method.
- BIt does NOT compile because an abstract class CANNOT have instance variables.
- CIt compiles without error.
- DIt does NOT compile because an abstract class CANNOT have private methods.
- EIt does NOT compile because an abstract class must have a constructor with no arguments.
How the community answered
(37 responses)- A5% (2)
- B3% (1)
- C76% (28)
- D14% (5)
- E3% (1)
Community Discussion
No community discussion yet for this question.