The code doesn't compile because the is no method getBidValue() defined anywhere. However there is a method called getValue(). Probably someone changed the name, but missed some code that references the old name.
Sandra Bachan wrote:2. When I comment out the offending line, why does the output include something confusing as [LBridge$Suits;@190d11
This is a sort of default "I don't know how to display the information you want" type of output. Where possible Java will try to output a reasonable string representation of an object, however in many (most?) cases the Java compiler decides that there is no reasonable output, and so it goes back to a default: from memory the output can be read as "literal" Bridge class, Suits subclass, at memory address 190d11. This, of course, is quite useless for humans, but can have limited value for decompilers and debuggers.
Sandra Bachan wrote:3. How do I trace through code, line by line.
This is probably the wrong forum for this question - you probably want to ask this question in the IDEs forum. Alternatively, searching Google for tutorial debug NetBeans may provide you with some useful suggestions. The first link I saw seems to me (a non NetBeans user) to be reasonably straightforward and what I would expect to see.
You found an error in the book and you have my apology. But, I wonder if you're using an old copy of the book because that error is fixed in the new version of the book?
In any case, if you search for "errata" in this forum you can find several lists of errors in the book - depending on which version you have.
p.s. I absolutely encourage you to test the code in the book, and play around with it, make changes, recompile, etc. BUT, I also STRONGLY recommend that you NOT use an IDE. The entire Sun exam was written and tested without IDEs, and so was our book. The problem with IDEs is that they 'help' you by doing stuff behind the scenes. In many cases the stuff they do is the stuff you need to learn for the exam.
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Joined: Feb 18, 2010
It's a great book to study from, especially the jokes every now and then. The version of the book I am using was published June 24, 2008.
By the way, I was using NetBeans to review chapters 1 through 3 before I proceed to chapter 4, but it seems that I'm focusing more of my time learning NetBeans rather than understanding the material for the exam, so I'll probably use JDK, (this is command-line, if I understand correctly?)
Will definitely search for errata - thanks!
Joined: Oct 14, 2002
Later on IDEs are great - they're just not the best for studying for the SCJP.
For now, you need to be able to type Java commands in at a command line, on a Mac you open a terminal window - on PCs you open up a DOS window.
Then you use a simple text editor to create and edit the actual .java files that you'll compile and run.
I'm assuming that since you have an IDE up and running that all your classpaths and such are already set up.
Joined: Feb 18, 2010
It seems the CLASSPATH (or rather, PATH) is set correctly because I am able to compile and run programs from the terminal in MAC.