• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Bram Vonk
Greenhorn
Posts: 4
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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.
 
Roel De Nijs
Sheriff
Posts: 10666
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
  • 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 (...).
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3820
10
  • Mark post as helpful
  • send pies
  • 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: 10666
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
 
Scott Selikoff
author
Saloon Keeper
Posts: 4033
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed dangling row.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic