File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Slightly different compile error msgs using 1.4.1

 
Linda Pan
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently using Sun's J2SDK 1.4.1 to compile any code in the books I'm using for certification ie. Mughal's and Kathy & Bert's latest book. As I was compiling classes from different packages in Kathy & Bert's book, I'm finding that my compile errors aren't exactly the same as the book. For example:

I compiled Beverage.java and then Tea.java. The latter causes the compiler to complain: "cannot inherit from final cert.Beverage"
According to Kathy & Bert's book, (page 65 - 66): "Can't subclass final classes ... 1 error". Any reason as to why this would happen? To me, the compile errors are really saying the same thing regarding the final being used in the class. I gues it may be because I am using a slightly different version of JDK compiler?
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, and what's more, the error messages are compiler vendor dependent.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The exact error wording is not specified in the JLS so compiler writers are free to make the wording how they like. The important thing is to know that it will always cause a compile error.
 
Linda Pan
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An interesting finding. Thank you for responding and confirming my question.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic