Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

OCA 8 - concrete class must inherit abstract methods

Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hiya everyone,

I have a question from the OCA study guide, chapter 5 question 15:

Which of the following is true about concrete subclass?
b. A concrete subclass must implement all inherited abstract methods.
c. A concrete subclass must implement all methods defined in an inherited interface.

I don't understand why option B is correct whilst C is incorrect. According to the book option C is incorrect because a superclass could have implemented the methods. But wouldn't the same also apply to option B? All methods in interfaces are abstract and they can could be implemented by the superclass (whether concrete or even abstract) rather than the subclass. Would someone be able to explain this one?


Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The key is what makes an (inheriting) subclass concrete?  A lack of undefined methods makes a subclass concrete.  Option B has a laser focus on defining only the undefined methods.  Whereas Option C blindly assumes that even if undefined methods were defined in one or more middle classes, that these undefined methods would still need to be again redefined for an (inheriting) concrete subclass.  This would not make sense of course, because once a method has initially been defined, then that method is no longer abstract because the method is no longer undefined.

I hope that helps,
Posts: 3959
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And, not to forget, C talks about ALL methods in the interface. But default and static methods already have an implementation.

Question: can you override a static method? If not, how is this called?
Posts: 260
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Piet, if I may, I'd like to give it a shot  

I'm also preparing for my OCA certification exam.

Static methods cannot be overridden, but it leads to method hiding?
I've never won anything before. Not even a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic