nerdexam
CompTIA

ADR-001 · Question #7

Which of the following describes what is wrong with the following sample code? public class MyActivity extends Activity{ public void onCreate(Bundle myBundle){ foo( ); } }

The correct answer is C. A call is missing to super.onCreate(mybundle). See the full explanation below for the reasoning.

Question

Which of the following describes what is wrong with the following sample code? public class MyActivity extends Activity{ public void onCreate(Bundle myBundle){ foo( ); } }

Options

  • AThe method onCreate must be private.
  • BA developer cannot extend Activity.
  • CA call is missing to super.onCreate(mybundle).
  • DThe class MyActivity must be private.

How the community answered

(30 responses)
  • A
    13% (4)
  • B
    3% (1)
  • C
    77% (23)
  • D
    7% (2)

Community Discussion

No community discussion yet for this question.

Full ADR-001 Practice