|
NOTA: La traducción de esta documentación es un esfuerzo personal y voluntario, no es un documento oficial de Sun Microsystems
ni Oracle ni está patrocinado por ninguna de estas empresas. Los documentos originales (en inglés) están disponibles en:
http://java.sun.com/docs/books/tutorial/.
Dirija cualquier comentario, petición, felicitación, etc. a tutorialesjava_@RROBA_codexion.com. |
Si desea ayudar a mantener en funcionamiento esta web, colaborar con la traducción de estos documentos o necesita que se traduzca algĂșn capĂtulo en concreto puede realizar una donación directa mediante Paypal:
|
Within a class, a field that has the same
name as a field in the superclass hides the
superclass's field, even if their types are
different. Within the subclass, the field in
the superclass cannot be referenced by its simple name.
Instead, the field must be accessed through
super, which is covered in the next section.
Generally speaking, we don't recommend hiding fields as it makes code difficult to read.