Daniela, parte de este gran staff, nos ha hecho el favor de escribir este enunciado porque domina muy bien el tema.
Ejemplo: palabra clave super en java
Variables and methods of superclass can
be overridden in subclass.
Incase of overriding , a subclass
object call its own variables and methods.
Subclass cannot access the variables and
methods of superclass because the overridden
variables or methods hides the
methods and variables of superclass.
But still java providesa way toaccesssuperclass members even if
its members are overridden. Super is
used toaccess superclass variables, methods,constructors.
Super can be used in two forms :1)First form is for calling superclass constructor.2)Second one is tocallsuperclass variables,methods.
Superif present must be the first statement.
Comentarios y puntuaciones
Recuerda que tienes la capacidad de valorar esta sección si hallaste tu atolladero .
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)