Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

279
Vistas
Abstract method in abstract Derived class overrides/implements abstract or concrete method of abstract Base class. How and why?

Came across interesting inheritance / overriding issue (taken from here).

When both Base and Derived classes are abstract, and

  1. both have exactly same abstract method, or
  2. abstract Base has concrete method, and Derived declares SAME method abstract.

I don't understand why Eclipse IDE calls it in Derived

  1. implements (it gives NO CODE / BODY in Derived!)
  2. overrides (also gives NO CODE / BODY in Derived!)

Snippet 1:

public abstract class Girl {
     abstract String getDescription();
}


abstract class GirlDecorator extends Girl {
       abstract String getDescription();  // implements Girl.getDescription() - says Eclipse IDE
}

Snippet 2:

public abstract class Girl {
    String description = "no particular";

      String getDescription() {
          return description;
      }
}

abstract class GirlDecorator extends Girl {
       abstract String getDescription();  // overrides Girl.getDescription() - says Eclipse IDE
}
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

In Java there are two types of methods (non-static)

  1. Virtual - Normal method, must be implemented in the base class but can be overridden by inheritance.

  2. Abstract - Method that is not implemented in the base class but in the derived class.

So that wraps it, virtual methods are not implemented in the derived class, they are implemented in the base class and can be overridden by the derived class. Abstract methods are not implemented in the base class, they are implemented in the derived class.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda