Java Reference
In-Depth Information
new
to allocate a larger amount of memory and then copying over individual ele-
ments. This process is done automatically by the
ArrayList
.
Exceptions
are used to signal exceptional events. An exception is signaled
by the
throw
clause; it is propagated until handled by a
catch
block that is asso-
ciated with a
try
block. Except for the run-time exceptions and errors, each
method must signal the exceptions that it might propagate by using a
throws
list.
StringTokenizer
s are used to parse a
String
into other
String
s. Typically,
they are used in conjunction with other input routines. Input is handled by
Scanner
and
FileReader
objects.
The next chapter shows how to design new types by defining a
class
.
aggregate
A collection of objects stored in one unit. (37)
array
Stores a collection of identically typed objects. (37)
array indexing operator
[]
Provides access to any element in the array. (37)
ArrayList
Stores a collection of objects in array-like format, with easy expan-
sion via the
add
method. (42)
call-by-reference
In many programming languages, means that the formal
parameter is a reference to the actual argument. This is the natural effect
achieved in Java when call-by-value is used on reference types. (33)
catch
block
Used to process an exception. (48)
checked exception
Must be either caught or explicitly allowed to propagate by
a
throws
clause. (50)
command-line argument
Accessed by a parameter to
main
. (45)
construction
For objects, is performed via the
new
keyword. (31)
dot member operator
(
.
) Allows access to each member of an object. (30)
dynamic array expansion
Allows us to make arrays larger if needed. (40)
enhanced
for
loop
Added in Java 5, allows iteration through a collection of
items. (46)
equals
Used to test if the values stored in two objects are the same. (34)
Error
An unrecoverable exception. (50)
exception
Used to handle exception occurrences, such as errors. (47)
FileReader
Used for file input. (56)
FileWriter
Used for file output. (59)
finally
clause
Always executed prior to exiting a
try
/
catch
sequence. (48)
garbage collection
Automatic reclaiming of unreferenced memory. (31)
Search WWH ::
Custom Search