• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Possible errata on abstract classes, page 263 (Java OCA 8 Programmer I Study Guide, Sybex)

 
Greenhorn
Posts: 4
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IN chapter 5, on page 263 of the OCA Java 8 Study guide, in the second-to-last sentence of the second paragraph, it says:
"The key point is that the first class to extend the nonabstract class must implement all inherited abstract methods."
Shouldn't this be:
"The key point is that the first nonabstract class to extend an the nonabstract class must implement all inherited abstract methods."

Also: at the top of the errata table on http://www.selikoff.net/java-oca-8-programmer-i-study-guide/ there seems to be a dangling table row.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bram Vonk,

First of all, a warm welcome to CodeRanch!

Bram Vonk wrote:IN chapter 5, on page 263 of the OCA Java 8 Study guide, in the second-to-last sentence of the second paragraph, it says:
"The key point is that the first class to extend the nonabstract class must implement all inherited abstract methods."
Shouldn't this be:
"The key point is that the first nonabstract class to extend an the nonabstract class must implement all inherited abstract methods."


You are spot-on! From the moment you have a concrete class (nonabstract) you must implement all inherited abstract methods, otherwise your class won't compile. So the sentence should be updated to: "The key point is that the first concrete class to extend the abstract class must implement all inherited abstract methods." (or something similar of course).

Bram Vonk wrote:Also: at the top of the errata table on http://www.selikoff.net/java-oca-8-programmer-i-study-guide/ there seems to be a dangling table row.


Yeah, that's probably not how it's supposed to look. And it's weird because I looked at the source code of that page and all errata items are actually a table row with table data elements, but that one is just a paragraph. So something went wrong when one of the authors edited that page. But it will probably be rectified in the next few days.

Hope it helps!
Kind regards,
Roel
 
Bram Vonk
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:From the moment you have a concrete class (nonabstract) you must implement all inherited abstract methods (...)


Roel De Nijs wrote:So the sentence should be updated to: "The key point is that the first concrete class to extend the abstract class (...)


Bram Vonk wrote:Shouldn't this be:
"The key point is that the first nonabstract class (...)



That's something else that irked me: I wrote "nonabstract", because the book said on page 262:

book wrote:A concrete class is the first nonabstract subclass that extends an abstract class (...)


(emphasis mine)

Not only the first nonabstract class that extends an abstract class is concrete: all classes that extend a concrete are also concrete, right?

Then it should have been something like:

The first nonabstract subclass that extends an abstract class is called a concrete class (...).
 
Enthuware Software Support
Posts: 4768
52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bram Vonk wrote:Then it should have been something like:

The first nonabstract subclass that extends an abstract class is called a concrete class (...).


Seem like it is getting needlessly convoluted.
Simply put:
A class that inherits an abstract method but does not implement it, must be declared abstract. Any class that is not declared abstract is a concrete class.
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bram Vonk wrote:Not only the first nonabstract class that extends an abstract class is concrete: all classes that extend a concrete are also concrete, right?


No, definitely not! An abstract class can easily extend from a concrete class which extends from another abstract class. Illustrated in this code snippet

Any class which is not marked as abstract is a nonabstract or concrete class. And if it extends an abstract class (and/or implements an interface with abstract methods), it must provide an implementation for all abstract methods; otherwise this nonasbtract (or concrete) class will not compile.

Hope it helps!
Kind regards,
Roel
 
author & internet detective
Posts: 41774
887
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And noted the errata.
 
Something about .... going for a swim. With this tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic