Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

280
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!