• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Slightly different compile error msgs using 1.4.1

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, and what's more, the error messages are compiler vendor dependent.
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An interesting finding. Thank you for responding and confirming my question.
 
If you have a bad day in October, have a slice of banana cream pie. And 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