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)- A13% (4)
- B3% (1)
- C77% (23)
- D7% (2)
Community Discussion
No community discussion yet for this question.