nerdexam
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:
  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?

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)
  • A
    5% (2)
  • B
    3% (1)
  • C
    76% (28)
  • D
    14% (5)
  • E
    3% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-850 Practice