This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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 ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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

 
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.
 
Sheriff
Posts: 11338
177
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 (...).
 
Enthuware Software Support
Rancher
Posts: 4202
35
  • 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: 11338
177
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
 
author
Bartender
Posts: 4096
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed dangling row.
 
author & internet detective
Sheriff
Posts: 38561
654
Eclipse IDE Java VI Editor
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!