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?
Joined: Aug 03, 2002
Yes, and what's more, the error messages are compiler vendor dependent.