Troubleshooting

   

One Off Index Error

The first item from the String is not being used or printed.

Remember that like other things in the Java language, the index for a String starts at zero, not one. As you can no doubt figure out, the last index of a String is length “1. This does not affect the actual length of the String. It remains at exactly the number of characters that are in the String.

Incorrect String Representation

When I print out an Object, I see something that looks like this: classname@8e41.

To get a better String representation for an object to print out, you must override the toString() method for the class you are trying to print. Otherwise, the default toString() method will be used that is defined on the Object class.

   


Special Edition Using Java 2 Standard Edition
Special Edition Using Java 2, Standard Edition (Special Edition Using...)
ISBN: 0789724685
EAN: 2147483647
Year: 1999
Pages: 353

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net