Java Reference
In-Depth Information
The Object class contains several methods, and since it is not abstract,
all have implementations. The most commonly used method is toString ,
which we have already seen. If toString is not written for a class, an imple-
mentation is provided that concatenates the name of the class, an @ , and the
class's “hash code.”
Other important methods are equals and the hashCode , which we will dis-
cuss in more detail in Chapter 6, and a set of somewhat tricky methods that
advanced Java programmers need to know about.
4.5.2 the hierarchy of exceptions
As described in Section 2.5, there are several types of exceptions. The root of
the hierarchy, a portion of which is shown in Figure 4.18, is Throwable , which
figure 4.18
The hierarchy of
exceptions (partial
list)
Throwable
Error
Exception
OutOfMemoryError
InternalError
UnknownError
java.io.IOException
RuntimeException
java.io.FileNotFoundException
NullPointerException
ArrayIndexOutOfBoundsException
ArithmeticException
UnsupportedOperationException
NoSuchMethodException
InvalidArgumentException
java.util.NoSuchElementException
java.util.ConcurrentModificationException
java.util.EmptyStackException
ClassCastException
 
Search WWH ::




Custom Search