Multiple choice general knowledge science & technology

How we can access the members of the super class from child class??

  1. using super keyword

  2. defining the required class members as private

  3. define in members protected and using super keyword in subclass

  4. we cant access

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

To access superclass members from a subclass, the members must be declared with appropriate access (protected or public) and then accessed using the 'super' keyword. Option A is incomplete because it doesn't specify the access modifier requirement. Option B is wrong because private members are not accessible outside the class. Option D is incorrect because superclass members can indeed be accessed if properly declared.