Multiple choice

Which of the following are true regarding super keyword? i. Any level can be accessed using super keyword. ii. In the constructor, if super() method is used, it should be the first code. iii. Super is the keyword which is used to access method or member variables from the superclass. iv. Super is the keyword which is used to access method or member variables from the subclass.

  1. i and ii both are correct

  2. ii and iii both are correct

  3. i and iv both are correct

  4. i and iii both are correct

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This answer is correct. Always the super() method when used in constructor should be placed as first code. If it is placed at any other place, compilation errors will occur. Also, super keyword is used to access method and member variables from the superclass.