O GoConqr está de visual novo! Conte para nós o que você achou.

Mapa mental

Inheritance

Ana Ausek Inglês

Conteúdo do mapa

Inheritance

  1. Code Extensibility

    • extends keyword; Java only allows 1 extension per class
      • Create new class; subclass
        • Parent-child relationship
          • Method Override
            • Write method with same signature as parent class method
              • Change existing method behaviors
          • Child has "is-a" relationship to Parent
            • Child inherits all public methods of Parent
              • Allows reference variable of parent type in assignment of a subclass instance
                • Subclass can access public and protected just not private methods from superclass
        • keyword new to create an instance
          • When subclass object is instantiated, so are all parent's classes
      • Ex: public class Child extends Parent {}
    • final keyword
      • Prevent method override; no change in behavior allowed
      • Does not permit Method Override
        • Speed improvement but design should be main concern
      • Ex: public final class Pencil{}
    • java.lang.Object
      • Ultimate Java superclass
    • keyword super represents instance of direct superclass of current object
      • Invoke superclass constructor
      • Call a hidden member or an overriden superclass method
    • Type Casting
      • Possible only to cast subclass instance to parent class; "Upcasting"
        • "Downcasting" if parent instance is cast as child class
    • instanceof keyword
      • test if object is of specified type; ex: if it's type of its superclass

Informações

Descrição
Mapa Mental sobre Inheritance, criado por Ana Ausek em 03-08-2019.
Criado por
Ana Ausek
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?