-
- Weitere Informationen zu diesem Buch:
Inhaltsverzeichnis | Index | Probekapitel | Kolophon | Rezensionen |
Download der Beispiele |
- Weitere Informationen zu diesem Buch:
Fifth Edition März 2005
ISBN 978-0-596-00773-7
Weitere Informationen zu diesem Buch
Inhaltsverzeichnis |
Index |
Probekapitel |
Kolophon |
Rezensionen |
Download der Beispiele |
Index
[ Symbols ], [ Numbers ], [ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ K ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ], [ Y ], [ Z ], Chapter 24 24
Symbols[ Top ]
& (ampersand)
&= (bitwise AND assignment) operator, 29, 39
& (bitwise AND) operator, 29, 37
& (boolean AND) operator, 29, 36
&& (conditional AND) operator, 29, 35
< > (angle brackets)
< and > relational operators, string comparison and, 208
< and > separator characters (tokens), 21
> (greater than) operator, 14, 29, 35
>= (greater than or equal) operator, 29, 35
<<= (left shift assignment) operator, 29
<< (left shift) operator, 29, 38
< (less than) operator, 29, 35
<= (less than or equal) operator, 29, 35
<<= (signed left shift assignment) operator, 39
>>= (signed right shift assignment) operator, 29, 39
>> (signed right shift) operator, 29, 38
>>>= (unsigned right shift assignment) operator, 29, 39
>>> (unsigned right shift) operator, 29, 38
generics, use in, 159
* (asterisk)
*= (multiplication assignment) operator, 29, 39
dereference operator (C/C++), 82
in doc comments, 313
multiplication operator, 14, 29, 33
@ (at sign)
filenames beginning with, Java compiler and, 338
filenames preceded by
javadoc program, 342
in doc comments, 313
separator character (tokens), 21
\ (backslash)
character escapes in regular expressions, 213
escaping in char literals, 23
[ ] (brackets)
array access operator, 29, 31, 41
index operator, 75, 78
in multidimensional arrays, 80
separator characters (tokens), 21
^ (caret)
^= (bitwise XOR assignment) operator, 29, 39
bitwise XOR operator, 29, 38
boolean XOR operator, 29, 37
: (colon)
assertion expressions, separating, 60
conditional operands, separating, 31, 40
in statement labels, 43
separator character (tokens), 21
superclass, indicating in C++, 115
, (comma)
separating list of expressions, 76
separating variable names and initializers, 44
separator character (tokens), 21
{ } (curly braces)
anonymous class formatting, 154
enclosing body of loop, 14
enclosing statement blocks, 44
in classes, 9
inline doc comment tags, 316
method body, enclosing, 11, 12
nested if statements, use with, 45
nesting arrays within arrays, 81
separator characters (tokens), 21
-> (dereference) operator, C/C++, 82
$ (dollar sign)
in identifiers, 20, 309
in regular expressions, 213
. (dot)
dot operator in Java and C/C++, 82
object member access operator, 29, 41, 73
separator character (tokens), 21
... (ellipsis) in variable-length argument lists, 69
= (equal sign)
= (assignment) operator, 11, 29, 39
combining with arithmetic, bitwise, and shift operators, 39
= = (equals) operator, 29, 35, 132
comparing enum values, 180
comparing hashtable key objects, 225
comparing objects, 85
string comparisons, 208, 493
! (exclamation point)
! (boolean NOT) operator, 29, 36
!! (jdb shorthand) command, 354
!= (not equals) operator, 29, 35
jar: URL syntax, 564
- (minus sign)
-- (decrement) operator, 29, 34
-= (subtract assignment) operator, 29, 39
- (subtraction) operator, 14, 29, 31, 33
- (unary negation) operator, 29, 31, 33
integer literals and, 24
( ) (parentheses)
cast operator, 29
conditional operands, using with, 40
in expressions, order of evaluation and, 32
in method names, 10
in method parameters, 10
method invocation operator, 29, 41
side effects, 32
operator precedence, overriding with, 30
separator characters (tokens), 21
subexpressions within regular expressions, 213
% (percent sign)
%= (modulo assignment) operator, 29, 39
% (modulo) operator, 29, 33
in format specifiers, 780
+ (plus sign)
+= (add assignment) operator, 29, 39
concatenating strings with, 33
+ (addition) operator, 29, 32
++ (increment) operator, 29, 34
side effects, 32
+ (string concatenation) operator, 29, 33
+ (unary plus) operator, 29
string concatenation operator, 208
URL encoding, 585
? (question mark)
?: (conditional) operator, 29, 39
operand number and type, 31
return type, 31
jdb help command, 354
wildcards
type parameters, 167
" (quotes, double)
escaping in char literals, 23
in string literals, 73
string literals, 24
' (quotes, single)
escape characters in char literals, 23, 73
; (semicolon), 8
ending do loops, 49
ending Java statements, 11
compound statements and, 14
for empty statements, 43
separator character (tokens), 21
/ (slash)
/** */, in doc comments, 20, 312
/* */, in multiline comments, 9, 19
/ (division) operator, 29, 33
/= (divide assignment) operator, 29, 39
//, in single line comments, 8, 19
~ (tilde), bitwise complement operator, 29, 37
_ (underscore), identifier names and, 20
| (vertical bar)
|= (bitwise OR assignment) operator, 29, 39
| (bitwise OR) operator, 29, 37
| (boolean OR) operator, 29, 37
|| (conditional OR) operator, 29, 36
Numbers[ Top ]
0- and 1-based arrays, 78
0 (zero)
division by, 33
negative and positive zero, 26
represented by float and double types, 26
A[ Top ]
<A> (hyperlink) tag, avoiding in doc comments, 313
AbortPolicy class, 853
absolute filenames, 397
abstract classes, 128-130
collections, 238
InstantiationError, 471
InstantiationException, 471
interfaces vs., 135, 138
abstract methods, 128-130
AbstractMethodError, 443
dynamic method lookup, 130
interfaces, 135
abstract modifier, 156
in class definitions, 100
enumerated types and, 190
methods, 67
AbstractCollection class, 753
AbstractExecutorService class, 828
AbstractInterruptibleChannel class, 625
AbstractList class, 238, 754
AbstractMap class, 755
AbstractPreferences class, 893
AbstractQueuedSynchronizer class, 863
AbstractQueuedSynchronizer.ConditionObject, 864
AbstractSelectableChannel class, 626
AbstractSelectionKey class, 626
AbstractSelector class, 627
AbstractSequentialList class, 756
AbstractSet class, 757
AbstractStringBuilder class, 443
accept( )
FileFilter interface, 400
FilenameFilter interface, 401
ServerSocket class, 570
ServerSocketChannel class, 272, 621
access control, 124-127, 299, 301-304
class members, 125
classes, 125, 638
digitally signed classes, 302
to files, 402
for packages, 124
IllegalAccessError, 468
inheritance and, 126
java.security package, 288
packages for, 204
permissions and policies, 303
policies described in system, user, and java.security.policy policy files, 306
sandbox, 301
trusted vs. untrusted code, changes in Java 1.2, 303
access modifiers, 124
class members, 99
(see also private modifier; protected modifier; public modifier)
AccessControlContext class, 641
AccessControlException, 642
AccessController class, 303, 639, 642
checkPermission( ), 304
AccessibleObject class, 530
setAccessible( ), 540
accessor methods, 127-128
bean properties, 321, 322-323
AccountException class, 987
AccountExpiredException, 987
AccountLockedException, 987
AccountNotFoundException, 987
acquire( ) (Semaphore), 249
action names, permissions, 306
activeCount( ) (ThreadGroup), 506
activeGroupCount( ), 506
adapter classes, 152
add( ), 757
AbstractCollection class, 753
AbstractList class, 754
BigDecimal class, 543
Collection interface, 227, 766
HashSet class, 787
LinkedList class, 795
List interface, 229, 797
ListIterator interface, 798
Permissions class, 667
Queue interface, 234
Set interface, 227, 813
TreeSet class, 821
Vector class, 824
add and remove methods for event listeners, 321
addAll( )
Collection interface, 766
List interface, 229, 797
Map interface, 233
Set interface, 227
addAllAbsent( )
CopyOnWriteArrayList, 835
addAttribute( ) (AttributedString), 727
addAttributes( ) (AttributedString), 727
addCertPathChecker( ), 699
addCertStore( ), 700
addIfAbsent( )
CopyOnWriteArrayList, 835
addition operator (+), 32
additive operators, associativity of, 30
addObserver( ) (Observable), 805
addPreferenceChangeListener( ), 295
addPropertyChangeListener( ), 323
addProvider( ) (Security), 672, 676
addShutdownHook( ) (Runtime), 114, 297
addVetoableChangeListener, 323
Adler32 class, 910
after( ), 222
agents, 203, 296, 336
instrumentation, 517
support for, in java.lang.instrument, 439
AlgorithmParameterGenerator class, 643
AlgorithmParameterGeneratorSpi class, 643
AlgorithmParameters class, 644
AlgorithmParameterSpec interface, 713
AlgorithmParametersSpi class, 644
algorithms, cryptographic
digital signature algorithm for certificate, 365
RC2 encryption algorithm, 944
RC5 encryption algorithm, 945
specifying for keys, 365
aliases( ) (Charset), 629
aliases for certificates and keys, 362
allAll( ) (Set), 813
allocate( )
ByteBuffer class, 589
CharBuffer class, 593
DoubleBuffer class, 595
FloatBuffer class, 596
IntBuffer class, 597
ShortBuffer class, 600
allocateDirect( ) (ByteBuffer), 589
allocating/deallocating memory (see garbage collection; memory)
AllPermission class, 645
AlreadyConnectedException, 602
AND operator (see &, under Symbols)
animation, threads for, 241
annotations, xviii, 159, 191-202, 511-515
AnnotatedElement interface, 198, 456, 531
Annotation class, 725
Annotation interface, 199, 511
annotation types, 159, 440, 441, 511
defined, 192
defining, 199
Deprecated, 194, 462
Documented, 513
Inherited, 514
local scope and, 148
nonstatic member classes and, 145
Override, 194, 481
Retention, 514
annotations, annotation types (continued)
SuppressWarnings, 195, 499
Target, 515
AnnotationFormatError, 512
AnnotationTypeMismatchException, 512
apt processing tool, 326
Class class methods, 456
concepts and terminology, 192
Constructor class support for, 533
ElementType, 513
Field class support of, 534
IncompleteAnnotationException, 513
java.lang.annotation package, 203, 439
meta-annotations, 201
Method class, support for, 538
@Override, 71, 131
reflection on, 198, 529
RetentionPolicy, 514
standard, 194-196
@Deprecated, 194
@Override, 194
@SuppressWarnings, 195
@SuppressWarnings, 164
syntax, 196-198
defaults and, 198
member types and values, 197
targets, 197
treated as modifiers, 66
annotationType( ), 512
anonymous array literals, 77
anonymous classes, 141, 151-154
features of, 153
implementation of, 155
implementing adapter classes with, 152
indentation and formatting, 154
restrictions on, 153
subclasses of enumerated types, 187
syntax for defining and instantiating, 153
when to use, 153
APIs (application programming interfaces), 135
core Java APIs, 1
extensions, 1
platforms and operating systems, 2
apostrophe (see ', under Symbols)
AppConfigurationEntry class, 988
LoginModuleControlFlag, 988
append( ) (StringBuffer), 496
Appendable interface, 207, 386, 440, 444
formatting text for, 211
implemented by PrintStream, 424
applets, 10
access control restrictions, 303
java.applet package, 204
security and, 299
security restrictions on, 301
application classes, default search path for, 351
application programmers, security for, 304
applyPattern( )
ChoiceFormat class, 731
DecimalFormat class, 737
MessageFormat class, 743
SimpleDateFormat class, 748
apt (annotation processing) tool, 326
Arabic text, 728
arbitrary-precision integers, 204
arguments, method, 12, 64
IllegalArgumentsException, 468
testing for legal values with assert statement, 63
variable-length argument lists, 69, 97
(see also variable-length argument lists)
arithmetic
BigDecimal class, 543
precision, 547
integer arithmetic in Java, 25
java.math package, 204
arithmetic operators, 32
combining with assignment (=) operator, 39
listed, 29
return type, 31
ArithmeticException, 445
array access operator ([ ]), 29, 31, 41
ArrayBlockingQueue, 251, 829
arraycopy( ) (System), 79, 224, 500
ArrayList class, 231, 758
arrays, 12, 74-81, 224
accessing array elements, 78
Array class, 529, 531
array types, 75
widening conversions, 75
arrays (continued )
ArrayIndexOutOfBoundsException, 57, 78, 322, 445
Arrays class, 224, 759
equals( ), 85
ArrayStoreException, 76, 445
as operand type, 31
AtomicIntegerArray, 857
bounds, 78
of bytes, 255
ByteArrayInputStream class, 390
ByteArrayOutputStream class, 391
reading from and writing to, 385
of characters, 391
comparing for equality, 85
conversion rules, 87
converting collections to and from, 237
converting to strings, 34
copying, 79
creating and initializing, 76
initializers, 76
creating with new operator, 41
generic methods and, 175
GenericArrayType, 535
indexed properties, JavaBeans, 322
instanceof operator, using with, 40
iterating, 78
locks on, 56
multidimensional, 80
rectangular arrays, 81
NegativeArraySizeException, 477
as objects, 225
ObjectStreamField objects, 316
of parameterized type, 166
streaming data to and from, 257
of strings, 10
utility methods, 79
asCharBuffer( ) (ByteBuffer), 593
ASCII
7-bit character set, 18
native2ascii tool, 366
asDoubleBuffer( ) (ByteBuffer), 595
asFloatBuffer( ) (ByteBuffer), 596
asIntBuffer( ) (ByteBuffer), 597
asList( ) (Arrays), 759
asLongBuffer( ) (ByteBuffer), 598
assertions, 60-64
AssertionError class, 60, 445
classes loaded through ClassLoader, 459
compiling, 61
disabling, 61
enabling, 61
errors in, 64
options for Java interpreter, 334
side effects, 63
using, 62
asShortBuffer( ) (ByteBuffer), 600
assignment in expression statements, 42
assignment operators, 11, 29, 39
combining with arithmetic, bitwise, and shift operators, 39
return type, 31
right-to-left associativity, 30
side effects, 32
associativity, operator, 28, 30
order of evaluation and, 32
asterisk (*) (see *, under Symbols)
AsynchronousCloseException, 602
atomic operations, 252, 750, 855-862
createNewFile( ) (File), 398
AtomicBoolean class, 856
AtomicInteger class, 252, 856
AtomicIntegerArray class, 857
AtomicIntegerFieldUpdater class, 857
AtomicLong class, 858
AtomicLongArray class, 859
AtomicLongFieldUpdater class, 859
AtomicMarkableReference class, 860
AtomicReference class, 860
AtomicReferenceArray class, 861
AtomicReferenceFieldUpdater class, 861
AtomicStampedReference class, 862
Attr interface (DOM), 1033
Attribute class, 726
AttributedCharacterIterator interface, 725
AttributedString class, 726, 727
AttributeList interface (SAX), 1052
AttributeListImpl class (SAX), 1069
Attributes class, 870
Name class, 871
attributes (DOM Element node), 1033
Attributes interface (SAX), 1052
Attributes2 interface (SAX), 1065
Attributes2Impl interface (SAX), 1065
AttributesImpl class (SAX), 1070
authentication, 301, 970-993
Authenticator.RequestorType, 552
classes, 288
implementing with, 638
MAC (message authentication code), 921, 933, 934
messages transmitted with secret key, 933
packages for, 204
PasswordAuthentication class, 567
SSL client, 965
Authenticator class, 551
@author javadoc tag, 314
AuthPermission class, 971
AuthProvider class, 645
autoboxing and unboxing conversions, xvii, 69, 88, 89, 159
automatic imports, 91
available( ) (InputStream), 407
availableCharsets( ) (Charset), 629
await( )
Condition class, 248
CountDownLatch class, 249
CyclicBarrier class, 250
AWT programming (java.awt.peer), 310
B[ Top ]
\b (escape sequence for backspace), 23
BackingStoreException, 894
BadPaddingException, 922
bag (unordered collection), 754
BasicPermission class, 646
before( ), 222
Bidi class, 728
Bidirectional Algorithm (Unicode), 728
BigDecimal class, 218, 543-546
BIG_ENDIAN byte order, 592
BigInteger class, 219, 546
implementing Callable, 243
binary data in files, reading from arbitrary locations, 253
binary files, reading, 255
binary numbers, 37
Integer type conversions, 472
Long type conversions, 474
binary operators, 31, 33
binarySearch( )
Arrays class, 79, 224, 759
Collections class, 237, 767
bind( )
DatagramSocket class, 556
ServerSocket class, 570
Socket class, 572
BindException, 552
bitCount( ) (Integer), 472
bitfields (C language), 96
BitSet class, 761
bitwise operators, 29, 37
boolean operators as, 36
combining with assignment operator, 39
return type, 31
blank lines in Java programs, 13
Bloch, Joshua, 133, 190
BLOCKED thread, 239, 504
blocking queues
ArrayBlockingQueue, 829
defined, 234
LinkedBlockingQueue, 844
PriorityBlockingQueue, 845
blocking threads, waking, 250
BlockingQueue interface, 225, 248, 830
body (class definitions), 99
boolean operators, 35
listed, 29
return type, 31
boolean type, 14, 22
Boolean class, 439, 446
conversion to other primitive types, 28
get methods and, 128
operator return values, 31, 34
bound properties, 321, 322
bounded wildcards, 168, 178, 542
in generic methods, 172
in generic types, 171
bounds for type variables, 170
boxing and unboxing conversions, xvii, 69, 88, 159
break statements, 54
labels, use of, 43
switch statements, stopping, 47
BreakIterator class, 729
breakpoints for jdb debugger, 354, 356
BrokenBarrierException, 831
BufferedInputStream class, 386, 388
BufferedOutputStream class, 386, 388
BufferedReader class, 386, 389
BufferedWriter class, 390
BufferOverflowException, 588
buffers, 386, 586
basic operations, 264
Buffer class, 587
byte order, 592
byte, views as other primitive types, 590
ByteBuffer class, 264, 267, 589-592
channels, using with, 265
CharBuffer, 207, 267, 593-594
DoubleBuffer, 595
FloatBuffer, 595
IntBuffer class, 596
InvalidMarkException, 597
LongBuffer, 598
MappedByteBuffer, 599
networking, size of, 556
pushback, 427, 428
ReadOnlyBufferException, 599
ShortBuffer, 600
size, setting for sockets, 570, 572
StringBuffer class, 495-497
using with StringWriter, 435
BufferUnderflowException, 589
bugs
implementation-specific, portability and, 311
security-related, 5
build( ) (CertPathBuilder), 689, 698
by reference, 158
byte code, 6
displaying for methods with javap tool, 350
verification of, 300
byte streams, 254
ByteArrayInputStream class class, 390
ByteArrayOutputStream class, 391
CharConversionException, 393
FileInputStream class, 400
FileOutputStream class, 401
InputStream class, 407
java.io classes, 385
PrintStream class, 424
implementing Appendable, 386
reading, 255, 394
(see also input/output)
byte type, 22, 24
Byte class, 217, 439, 447
conversion to other primitive types, 28
unsigned values, 394
ByteArrayInputStream class, 257, 385, 390
ByteArrayOutputStream class, 257, 385, 391
ByteBuffer class, 264, 267, 589-592
ByteChannel interface, 266, 603
byte-code verification, 510
byte-code-to-native code JIT compilers, 462
ByteOrder class, 592
bytes
buffers of, converting to buffers of characters, 263
CharConversionException, 393
converting characters to, 421
converting objects to, 286
converting to characters, 403
input/output, filtering, 385
raw, reading from a stream, 386
transferring from FileChannel to another channel, 269
C[ Top ]
C and C++
array bounds, 78
boolean type, Java differences, 22
C++ features not found in Java, 157
comments, recognition by StreamTokenizer, 433
differences between C and Java, 95-97
extends keyword (Java) vs. :, 115
finalization methods in Java vs. C++, 113
Java native methods, implementing in C, 348
memory allocation, 86
reclaiming, 111
multiple inheritance, interfaces as alternative to, 135
object-oriented programming in C++, 98
performance, Java vs., 6
reference types, 82
unsigned keyword, 24
variable declarations, 76
virtual functions in C++, 122, 129
void methods, 66
CA (certificate authority), 683
CacheRequest class, 553
CacheResponse class, 553
caching
ResponseCache class, 569
SecureCacheResponse class, 570
SSL sessions, 964
URLs, 583
Calendar class, 221, 222, 763
GregorianCalendar class, 785
calendar (XMLGregorianCalendar class), 999
call( ), 243
Callable interface, 243, 831
scheduling Callable objects, 244
CallbackHandlerProtection (KeyStore), 660
callbacks, 976-982
Callback interface, 977
CallbackHandler class, 991
CallbackHandler interface, 977
ChoiceCallback class, 978
ConfirmationCallback class, 978
javax.security.auth.callback, 970
LanguageCallback class, 980
NameCallback class, 980
PasswordCallback class, 980
TextInputCallback class, 981
TextOutputCallback class, 981
UnsupportedCallbackException, 982
CallerRunsPolicy class, 853
calling methods, 10
cancel( )
Timer class, 818
TimerTask class, 819
CanceledKeyException, 603
CancellationException, 832
canonical filenames, 397
canRead( ) (File), 397
canWrite( ) (File), 397
capacity( )
ArrayList class, 758
Vector class, 824
capacity (buffers), 587
carriage return (\r), 23
case
capitalization, Java naming conventions, 308
case-insensitive pattern matching, 214
characters, 448
charset names, 629
conversions in strings, 492
ignoring in string comparisons, 208, 492
case labels (switch statements), 47
for enumerated types, 181
restrictions on, 48
case-sensitivity in Java, 8, 19
casts, 27
( ) (cast) operator, 29, 41
ClassCastException, 457
hidden superclass field, accessing, 119
narrowing conversions, reference types, 87
objects to Object instance, 158
super and this, using, 123
(see also type conversions)
catch clause, 59
annotations on parameters, 198
catching errors in assertions, 64
catching exceptions, 56
jdb debugger, 354
try/catch/finally statement, 58-60
cbrt( ) (Math), 476
CDATASection interface (DOM), 1034
certificate authority (CA), 683
certificate revocation lists (see CRLs)
Certificate.CertificateRep class, 684
CertificateException, 685
CertificateExpiredException, 685
CertificateFactory class, 686
CertificateFactorySpi class, 687
CertificateNotYetValidException, 687
CertificateParsingException, 687
certificates
Certificate class, 683
Certificate interface, 639, 646, 651, 680
CertPathTrustManagerParameters class, 949
creating self-signed for public key associated with alias, 364
displaying contents with keytool, 364
in keystore file, 329
java.security.cert package, 682-707
management by keytool, 362-366
public key, associated with JAR file, 328
storing in keystore, 362
certificates (continued )
TrustedCertificateEntry (KeyStore), 662
X.500, distinguished name, 364
X509Certificate, private key for, 993
CertPath class, 688
CertPathBuilder, 689
CertPathBuilderException, 690
CertPathBuilderResult, 690
CertPathBuilderSpi, 691
CertPath.CertPathRep, 689
CertPathParameters, 691
CertPathValidator, 691
CertPathValidatorException, 692
CertPathValidatorResult, 693
CertPathValidatorSpi, 693
CertSelector, 693
CertStore class, 694
CertStoreException, 695
CertStoreParameters interface, 695
CertStoreSpi class, 695
chaining
certificates, 688
constructors, 117
finalizers, 118
methods
buffers, 265
overridden methods, 123
channel( ) (FileLock), 610
channels, 204, 263
avoiding explicit character encoding/decoding, 628
basic operations, 265
ByteChannel interface, 266
Channel interface, 601, 603
Channels class, 604
charset encoder/decoder, 630
DatagramChannel, 272, 556
FileChannel object, obtaining, 400, 401, 429
files, reading and writing, 268-270, 607
inheritedChannel( ), 501
interrupted threads and, 250
java.nio.channels package, 600-625
nonblocking, 273-276
ReadableByteChannel and WritableByteChannel, 266
server-side networking, 272
ServerSocketChannel, 272, 571
service provider interface, 625-628
SocketChannel, 573
client-side networking with, 271
streams and, 601
char literals, quoting in Java code, 73
char type, 22
char values vs., 71
Character class, 21, 448-451
new methods in Java 5.0, 448
static methods for working with characters, 23
conversion to other primitive types, 28
escape characters in char literals, 23
surrogate pair, Unicode supplementary characters, 448
character encoding
internationalization features, 6
locale- and platform-dependent, 407
native2ascii tool, 366
OutputStreamWriter class, 421
Unicode (see Unicode)
UnsupportedEncoding-Exception, 436
(see also charsets)
character sets (see charsets)
character streams, 254
CharConversionException, 393
filtering input streams, 405
input and output, 386
InputStreamReader class, 407
LineNumberReader class, 410
output, implementing Appendable interface, 386, 440
OutputStreamWriter class, 421
PipedReader class, 423
PipedWriter class, 424
PrintWriter class, 426
PushbackReader class, 428
Readable interface, implementing, 386
Reader (input stream superclass), 430
reading with BufferedReader, 389
streaming data to and from arrays, 257
StringReader class, 435
superclass of output streams (Writer), 437
writing with BufferedWriter, 390
(see also input/output; streams)
CharacterCodingException, 629
CharacterData interface (DOM), 1034
characters, 205-217
char data type, 22
Character class, 206, 439, 448-451
new methods in Java 5.0, 448
Subset class, 451
UnicodeBlock class, 452-454
CharacterIterator interface, 730
conventions for Java names, 309
converting between byte buffers and character buffers, 263
converting to bytes, 403
encoding into and decoding from bytes, 586
handling by StreamTokenizer, 433
in identifiers, 20
pattern matching with regular expressions, 212
reading and writing streams of, 254
string, CharSequence and CharBuffer interfaces, 207
testing for different categories of, 448
translating to bytes, 421
CharArrayReader class, 257, 391
CharArrayWriter class, 257, 392
charAt( )
CharSequence interface, 455
String class, 491
StringBuffer class, 496
CharBuffer class, 265, 267, 593-594
CharSequence interface, 207, 265, 455, 492
contentEquals( ), 208
charsets, 267, 586, 628-637
Charset class, 267, 629
CharsetDecoder class, 267
CharsetEncoder class, 267
CharsetProvider, 637
conversions, 421
decoding engine, 631
encoding and decoding text with
EUC-JP (for Japanese text), 267
encoding engine, 633
java.nio.charset package, 204
required support by Java implementations, 629
Unicode, 18
charValue( ) (Character), 448
checkAccess( )
Thread class, 502
ThreadGroup class, 506
checked exceptions, 68
methods throwing, 66
CheckedInputStream class, 910
checkedList( ) and checkedMap( ) (Collections), 165
CheckedOutputStream class, 911
checkError( ), 426
checkGuard( ) (Guard), 650
checkPermission( )
AccessControlContext class, 641
AccessController class, 304, 642
SecurityManager class, 487
checkRead( ) (SecurityManager), 302, 303
Checksum interface, 911
checksums, 255
(see also message digests)
checkValidity( ) (X509Certificate), 702
Chinese ideographs, 23
ChoiceCallback class, 978
ChoiceFormat class, 730
Cipher class, 291, 921, 923-925
NullCipher class, 935
cipher suites, SSL connections, 950
client/server disagreement on, 959
obtaining name of, 962
setting, 961
supported, getting full set of, 965
CipherInputStream class, 292, 925
CipherOutputStream class, 292, 926
CipherSpi class, 926
circular dependency, 458
class body, 99
access to members, 125, 126
anonymous classes, 152, 154
enumerated types, 185
value-specific, 186-189
Class class, 74, 283-285, 455-457
dynamic class loading, 285
dynamic instantiation with newInstance( ), 72
getMethod( ), 537
new methods, Java 5.0, 456
class fields, 102
default initialization, 109
initializing, 109
static initializers, using, 110
class fields (continued )
superclass, hiding, 119
System.out.println( ), 106
class files, 94
verification of, 300
class hierarchy, 87, 116
containment hierarchy vs., 147
omitting tree diagram in javadoc documentation, 346
class loading statistics (jstat), 361
class members
access control, 124-127
access rules, 126
constructors and initializers, 106-111
hiding fields and methods, 124
class methods, 102
choosing between class and instance methods, 105
example of, 103
interfaces and, 135
listing all for specified class with jdb debugger, 355
overriding not allowed, 120
static modifier, 67
synchronized, 56
System.out.println( ) ), 106
ClassCastException, 87
ClassDefinition class, 516
classes, 2, 5, 17, 71, 203
abstract, 128-130, 156
collections, 238
rules for, 129
access to, 125
anonymous, 141, 151-154
assertions, 61, 459
bean (JavaBeans), 321
byte-code verification, error, 510
Class (see Class class)
ClassCastException, 457, 770
ClassCircularityError, 458
ClassDefinition, 516
ClassFormatError, 458
ClassLoader class, 458
enabling/disabling assertions, 62
ClassNotFoundException, 460
code source, 647
constructors, fields, and methods, 529
converting to strings, 34
core, Java language, 203
creating dynamically, with Proxy, 286
defined, 98
defining, 9, 72, 99
modifiers, 99
NoClassDefFoundError, 477
static initializers, 110
defining object types, 98
deprecated (@deprecated javadoc tag), 315
digital signatures for, 302
disassembler tool (javap), 349-351
documentation by javadoc, display of, 346
dynamic loading, 285
enumerated types, 179
extending, 114-116
final, 116
garbage collection, disabling for, 336
hiding (and encapsulating) data in, 124
IllegalAccessError, 468
IllegalAccessException, 468
IllegalClassFormatException, 516
implementing interfaces, 136
IncompatibleClassChangeError, 470
inner (see nested types)
InvalidClassException, 408
Java platform, 1
javap display, including or excluding from, 350
LinkageError, 474
loading, 338
dynamically, with Class, 285
SecureClassLoader, 674
URLClassLoader, 582
local, 141, 147-151
members of, 9
class fields, 102
static and instance, 100
modifiers, 156
names, simple and fully qualified, 89
naming and capitalization conventions, 308
online documentation, 20
package, specifying for, 90
permission, summary of, 306
proxy, 540
public
in Java files, 94
preventing insertion of public constructor, 118
reference index, 1077-1146
references to, in @see javadoc tag, 318
reflection and dynamic loading, 283-286
structs vs., 96
system, code portability and, 311
undocumented, portability and, 310
UnsatisfiedLinkError, 509
UnsupportedClassVersionError, 509
version number, 370
ClassFileTransformer interface, 516
"Classic VM", 333
ClassLoadingMXBean interface, 518
classpaths
application classes, specifying for javap, 351
java, 333, 338
javac compiler, 342
javadoc program, 348
javah tool, 348
javap, for classes named on command line, 350
jdb debugger, 357
serialver tool, 370
clear( )
Buffer class, 588
Collection interface, 227, 766
List interface, 797
Map interface, 801
PhantomReference class, 526
Reference class, 527
clearAssertionStatus( ), 459
clearProperty( ) (System), 500
client applications, 261
-client option (HotSpot VM), 332
client-side networking, nonblocking I/O, 275
Clock class, 241
clone( ), 75, 79, 460, 464, 691
Mac class, 934
MessageDigest class, 663
Object class, 84, 134
Cloneable interface, 79, 134, 460
arrays, 75
implemented by collections and maps, 227
CloneNotSupportedException, 79, 84, 461, 464
close( )
OutputStream class, 420
Channel interface, 603
CharArrayWriter class, 392
Closeable interface, 386, 393
DatagramSocket class, 556
FileInputStream class, 400
FileOutputStream class, 401
InputStream class, 407
JarOutputStream class, 874
PrintWriter class, 426
Reader class, 430
Selector class, 605
ServerSocket class, 571
Socket class, 572
SocketChannel class, 623
StringWriter class, 435
Writer class, 437
Closeable interface, 386, 393
ClosedByInterruptException, 604
ClosedByInterruptException class, 250
ClosedChannelException, 604
ClosedSelectorException, 605
closeEntry( ) (ZipInputStream), 919
closeInbound( ), 956
closeOutbound( ), 956
code
critical sections, 56
formatting and indenting, 19
code blocks, synchronized, 245
code libraries, reading into the system, 501
codePointAt( )
Character class, 448
String class, 493
codePointBefore( ) (Character), 448
codePointCount( )
Character class, 448
String class, 493
codepoints, 23
illegal format exception, 790
CoderMalfunctionError, 633
CoderResult class, 634
CodeSigner class, 647
CodeSource class, 639, 647
CodingErrorAction class, 635
CollationElementIterator class, 731
CollationKey class, 732
Collator class, 209, 733
RuleBasedCollator class, 747
CollectionCertStoreParameters, 696
collections, 225-238
abstract classes to implement common collections, 238
AbstractCollection class, 753
AbstractList class, 754
AbstractMap class, 755
of certificates, 694
CertStoreParameters, 696
changes in Java 5.0, 751
classes in java.util package, 751, 752
Collection interface, 225, 766, 795
add( ) and addAll( ), 227
Collections class, 767
special-case collections, 236
utility methods, 237
wrapper methods, 236
Collections Framework, 225
generics in Java 5.0, 225
converting to and from arrays, 237
for/in loop, 52
Hashtables class, 293
immutable or unmodifiable, error, 510
implementing Cloneable or Serializable, 227
List interface, 229
Map interface, 231-234
packages for, 204
Permission objects, 667
primitive values, boxing and unboxing conversions, 88
queues, 234-235
RandomAccess interface, 225
runtime type safety, 165
Set interface, 227
typesafe (see generic types)
combination assignment operators, 39
combine( ) (DomainCombiner), 649
command( ) (ProcessBuilder), 482
command-line tools
enabling assertions, 61
Java interpreter, -classpath option, 94
javac compiler, 8
Comment interface (DOM), 1035
commentChar( ), 433
comments, 9, 19
doc, 312-320
single-line, enclosed with //, 8
StreamTokenizer and, 433
compact( ), 266
ByteBuffer class, 590
Comparable interface, 133, 176-178, 461
implementation by enumerated types, 180
Comparator interface, 770
compare( )
Collator class, 733
Comparator interface, 770
Double class, 463
compareTo( )
BigDecimal class, 543
BigInteger class, 546
ByteBuffer class, 591
Character class, 448
Charset class, 630
CollationKey class, 732
Comparable interface, 133, 461
Date class, 222
Double class, 463
Enum class, 464
enumerated types, 180
String class, 209, 492
compareToIgnoreCase( ), 208, 492
comparing
hashtable key objects, 225
strings, 208
comparison operators, 34
listed, 29
precedence, boolean vs., 36
return type, 31
compilation units, 18
compile( )
Pattern class, 214
XPath class, 1026
compileClass( ), 462
compileClasses( ), 462
Compiler class, 462
compiler (javac), 8, 338-342
compiling
assertions, 61
Java program (example), 7
varargs methods, 69
CompletionService interface, 832
compound statements, 14, 43
compression, 255
JAR files, 330
java.util.zip package, 909-920
Pack200, 875-877
pack200 tool, 366
unpack200 tool, 371
ZIP files and gzip format, 751
computed goto or jump table, 46
com.sun.javadoc package, 342
concat( ) (String), 493
concatenating data from multiple input streams, 431
concatenating strings, 208, 496
+ and += operators, 33
string literals, 74
concrete subclass, 129
concurrency, 238-252
atomic operations, 252, 750, 855-862
blocking queues, 251
BlockingQueue interface, 225, 234, 830
implementations, 251
ConcurrentHashMap class, 233
CopyOnWriteArrayList, 231
CopyOnWriteArraySet, 228
exclusion and locks, 245-247
deadlock, 247
Lock objects, 246
java.util.concurrent package, xviii, 204, 750, 827-855
locks, 750, 862-869
Condition objects, 248
running and scheduling tasks, 241-245
ExecutionException, 244
Executor interface, 242
ExecutorService, 243
Future object, 244
ScheduledExecutorService, 244
ThreadPoolExecutor, 243
Timer and TimerTask, 242
synchronizer utilities, 249
TimeUnit class, 241
ConcurrentHashMap class, 233, 832
ConcurrentLinkedQueue class, 235, 833
ConcurrentMap interface, 233, 834
ConcurrentModificationException, 771, 793, 798
Condition interface, 864
Condition objects, 248
conditional AND operator (&&), 29, 35
conditional operator (?:), 29, 31, 39
return type, 31
conditional OR operator (||), 29, 36
ConditionObject class, 864
Configuration class, 989
configuration files
logging, 212
Properties class, using for, 293
configureBlocking( )
SelectableChannel class, 617
SocketChannel class, 622
ConfirmationCallback class, 978
connect( )
DatagramChannel class, 606
DatagramSocket class, 556, 567
PipedInputStream class, 422
PipedOutputStream class, 422
PipedReader class, 423
Socket class, 572
SocketChannel class, 602, 622
ConnectException, 553
ConnectionPendingException, 605
console
displaying text on, 255
input, reading, 254
ConsoleHandler class, 878
constants
defined by an enumerated type, 456
ElementType, 513
enum, 179
EnumConstantNotPresentException, 465
HttpURLConnection, 559
in interface definitions, 135
inheritance of, 139
Java object serialization, 418
Modifier class, 539
naming conventions, 102, 309
RetentionPolicy, 514
RoundingMode, 548
separator characters defined by File class, 397
static and final
in anonymous classes, 153
in local classes, 148
static member import declarations, 93
Thread.State, 239
TimeUnit class, 241
XML, 995
DatatypeConstants, 996
(see also enumerated types)
constrained properties, 321, 323
Constructor class, 72
constructors, 66, 106-111
anonymous classes and, 152
chaining, default constructor and, 117
class, 529
Constructor class, 533
changes in Java 5.0, 533
defined, 107
defining, 107
multiple, 108
naming, declaring, and writing, 107
enumerated types, 180, 185, 190
field initialization code in, 109
how they work, 107
interfaces and, 135
invoking from another constructor, 108
local classes, enclosing instance passed to, 149
member classes, 146
references to, in @see javadoc tag, 319
subclass, 116
superclass, 116
containing classes
associating instance with local class, 148
instance, specifying for member class, 146
containment hierarchy, 147
contains( )
HashSet class, 787
Collection interface, 766
CopyOnWriteArraySet, 836
Set interface, 227
TreeSet class, 821
containsAll( ) (Collection), 766
containsKey( )
Map interface, 232, 801
TreeMap class, 820
containsValue( ) (Map), 801
contentEquals( )
CharSequence interface, 208
String class, 492
ContentHandler interface, 277, 554, 1053-1055
ContentHandlerFactory interface, 554
continue statements, 54
for and while loops, 60
labels, use of, 43
control flags (login module), 988
conversion types, Formatter, 779-782
conversions, type (see type conversions)
CookieHandler class, 554
copy( ) (Collections), 768
copy constructor, 134
CopyOnWriteArrayList class, 231, 834
CopyOnWriteArraySet class, 836
core Java APIs, 1
corrupted streams, 433
cosh( ) (Math), 476
CountDownLatch class, 249, 836
counters for loops, incrementing, 34, 48
covariant returns, xvii, 120, 159
AbstractStringBuilder class, 443
CRC32 class, 912
create( ) (URI), 579
createNewFile( ) (File), 398
createServerSocket( ), 962
createSocket( )
SocketFactory class, 947
SSLSocketFactory class, 966
createSSLEngine( ) (SSLContext), 955
createTempFile( ) (File), 398
CredentialException, 989
CredentialExpiredException, 990
CredentialNotFoundException, 990
credentials
destroying or erasing, 972
KerberosKey, 983
KerberosTicket, 984
PrivateCredentialPermission, 973
refreshing, 974
critical sections, 56
CRLs (certificate revocation lists), 682, 686
CRL class, 696
CRLException, 696
CRLSelector, 697
X509CRL class, 705
X509CRLEntry, 706
X509CRLSelector, 706
cross-references in doc comments, 318
cryptographic checksums (see message digests)
cryptographic-strength random numbers, 218
cryptography, 290-292, 301, 921-945
algorithms, parameters for, 644
arbitrary-precision integers, using, 543
BigInteger methods used for algorithms, 546
DSA, RSA, and EC public and private keys, 707-723
encrypted objects, 292
encrypting/decrypting streams, 292
encryption and decryption with Cipher, 291
Java Cryptography Extension (JCE), 639
javax.crypto package, 921-938
javax.crypto.interfaces package, 938-939
javax.crypto.spec package, 939-945
keys, invalid, 653
keytool program, 362-366
private key, 669
PublicKey interface, 673
public/private key, 639
in digital signatures, 289
key management, 362-366
keystore file for certificates, 329
resources for further reading, 922
secret keys, 290
service provider, not available, 665
symmetric-key, 290
cube root of a number, 476
currency formats, 744
currency symbols (Unicode), in identifiers, 20
currentThread( ) (Thread), 502
currentTimeMillis( ) (System), 221, 500
CyclicBarrier class, 250, 837
D[ Top ]
daemon, specifying thread as, 502
data
accessor methods, 127-128
compressing and writing to file, 255
encapsulation of, 99
hiding and encapsulating, 123-128
access control, 124-127
streaming (see input/output; streams)
data types, 11
array, 75
buffer classes for, 264
classes as, 71
conditional operands, 40
conversions (see type conversions)
declaring for variables, 43
element type (arrays), 74
equality, testing, 35
fields, initializing, 109
getSimpleName( ), 456
interfaces as, 137
literals (Class class), 74
method returns, 65
nested, 140-156
operand, 31
parameterized, 52
primitive, 21-27
floating-point, 25
integer types, 24
wrapper classes for, 217
(see also primitive data types)
reference, 22, 81-89
reflection and dynamic loading, 283-286
return, for operators, 31
specifying when added to API (@since doc comment), 315
strings, 73, 205
escape sequences, string literals, 24
in switch statements, 46
switch statement with case labels, 48
Type interface, 541
vs. values represented by, 71
XML, 994, 995-1000
DataFormatException, 912
DatagramChannel class, 272, 605
DatagramPacket class, 262, 555
datagrams, 262
defined, 555
DatagramSocket class, 262, 555
channel associated with, 556
DatagramSocketImpl class, 557
DatagramSocketImplFactory interface, 558
DataInput interface, 393
DataInputStream class, 386, 394
DataOutput interface, 395
DataOutputStream class, 386, 395
DatatypeConfigurationException, 996
DatatypeConstants class, 996
DatatypeConstants.Field class, 997
DatatypeFactory class, 997
newInstance( ), 996
Date class, 772
DateFormatSymbols class, 737
dates and times, 221-223
Calendar class, 222
certificate validity checks, 700
classes in java.util package, 751
Date class, 221, 222, 772
Duration class, 998
formatting, 223, 741
DateFormat class, 223
DateFormat.Field, 736
locale-specific, 737
formatting and parsing, 747
locale-specific formats, 734
milliseconds and nanoseconds, 221
period of validity (in days) for certificates, 366
System class, 500
Timestamp class, 680
TimeZone class, 819
XMLGregorianCalendar class, 999
deadlock (thread synchronization), 247, 525
debugger for Java classes (jdb), 353-357
debugging
assertions, enabling for, 60
HTTP clients, 261
Java interpreter options for, 336
java_g (debugging version of Java interpreter), 333
logging, using for, 211
remote (jsadebugd tool), 359
decimal numbers
BigDecimal class, 543-546
floating-point modes defined by IEEE 754R standard, 547
fractions, representing, 219
Short type conversions, 488
specifying decimal places, 544
DecimalFormat class, 737-739
DecimalFormatSymbols class, 739
declarations
class fields, 102
constructors, 107
exceptions, 68
field, 101
variable vs., 109
for/in loop variables, 51
GenericDeclaration interface, 535
methods, 10
package, 90
variables, 11, 76
local variables, 43
placement of, 14
DeclHandler interface (SAX), 1066
decode( )
Charset class, 629, 630
CharsetDecoder class, 629, 631, 634
CoderMalfunctionError, 633
Integer class, 472
Short class, 488
URLDecoder class, 585
decodeLoop( ), 633
decoding byte sequences into character strings, 267
decrement expression statements, 42
decrement operator (--), 29, 34
return type, 31
decryption (see cryptography)
deep copy, 85
deepEquals( ) (Arrays), 79
deepHashCode( ) (Arrays), 79
deepToString( ) (Arrays), 79
default constructor, 118
default: label, 47
enumerated types, 182
defaultCharset( ), 629
defaulted( ) (GetField), 414
DefaultHandler class (SAX), 277, 1071
DefaultHandler2 interface (SAX), 1066
defineClass( ) (SecureClassLoader), 674
definePackage( ) (ClassLoader), 459
defining
classes, 9, 72
simple (Circle class example), 100
static initializers, 110
constructors, multiple, 108
interfaces, 135
Java programs, 94
local classes, 147
methods, 10
packages, 90
system classes, portability and, 311
deflate( ) (Deflater), 912
Deflater class, 912
DeflaterOutputStream class, 913
Delay interface, 244
Delayed interface, 837
DelayQueue class, 251, 838
DelegationPermission class, 982
delete( )
File class, 398, 402
StringBuffer class, 496
delete permission, 402
deleteCharAt( ) (StringBuffer), 496
deleteEntry( ) (KeyStore), 658
deleteOnExit( ) (File), 398
deleting temporary files, 113
@Deprecated annotations, 194, 440, 462
deprecated features, omitting from javadoc documentation, 345
@deprecated javadoc tags, 194, 315
package.html file, 319
dereference operators (* and ->), C and C++, 82
DESedeKeySpec class, 940
deserializing objects (see serialization)
DESKeySpec class, 940
destroy( )
Destroyable interface, 972
KeyStore.PasswordProtection, 661
Process class, 482
Destroyable interface, 972, 993
DestroyFailedException, 972
destroying objects, 111-114
DHGenParameterSpec class, 941
DHKey interface, 938
DHParameterSpec class, 941
DHPrivateKey interface, 938
DHPrivateKeySpec class, 941
DHPublicKey interface, 939
DHPublicKeySpec class, 942
Dictionary class, 773
Diffie-Hellman key-agreement algorithm, 930
public/private key pairs, 938, 939
three-party agreement, 930
digest( ) (MessageDigest), 648, 664
DigestException, 648
DigestInputStream class, 256, 639, 648
DigestOutputStream class, 639, 649
digit( ) (Character), 448
digital signatures, 289, 301, 302
algorithm that signs a certificate, 365
jarsigner tool, 328
Signature class, 677
SignatureException, 678
SignatureSpi class, 679
SignedObject class, 290, 679
Signer class, 680
direct buffers, 589, 591
MappedByteBuffer, 599
directionality of a character, 448
directories, 252
creating, renaming, and deleting, 398
listing contents of, 397, 400
names of, platform-independent, 397
naming, portability and, 311
(see also files)
directory( ) (ProcessBuilder), 483
DiscardOldestPolicy class, 854
DiscardPolicy class, 854
disconnect( )
DatagramSocket class, 556
HttpURLConnection class, 559
displaying output, 12
displaying text on the console, 255
distinguished name
CRL issuer, 706
X.500 certificate, 364
distributed computing packages, 204
divide( ) (BigDecimal), 543
division by zero, 25, 33
division operator (/), 33
do statements, 49
continue, using, 55
doAs( ) (Subject), 975
doAsPrivileged( ) (Subject), 975
doc comments, 20, 312-320
cross-references, 318
defined, 312
images in, 313
in javadoc program output, 342
overview, use by javadoc, 346
for packages, 319
spaces in, 313
structure of, 313
tags
custom, 347
inline, within HTML text, 316
listing of, 314-318
doclet API (javadoc), 342
{@docRoot} javadoc tag, 317
Document interface (DOM), 1035
Document Type Definition (DTD), 1037
documentation
doc comments, 312-320
cross references, 318
doc-comment tags, 314-318
structure of, 313
documentation (continued )
javadoc program, 342-348
locale, 345
undocumented classes, portability and, 310
DocumentBuilder class, 1002
DocumentBuilderFactory class, 1003
@Documented annotations, 202, 462, 513
DocumentFragment interface, 1036
DocumentHandler interface (SAX), 1055
DocumentType interface (DOM), 1037
DOM (Document Object Model), 276
documentation, 1032
DocumentBuilder class, 1002
javax.xml.transform.dom package, 994, 1015-1016
org.w3c.dom package, 1032-1050
parser for XML, 204, 278
tree representation of XML documents, 280
validation of source documents, 1024
domain names, using in package naming, 90
DomainCombiner interface, 649, 975
DOMConfiguration interface, 1037
DOMError interface, 1038
DOMErrorHandler interface, 1038
DOMException class, 1038
DOMImplementation interface, 1040
DOMImplementationList interface, 1041
DOMImplementationSource interface, 1041
DOMLocator interface, 1015, 1041
DOMResult class, 1015
DOMSource class, 282, 1016
DOMStringList interface, 1042
double type, 12, 14, 22, 25, 462
conversion to other primitive types, 28
Double class, 26, 217
DoubleBuffer class, 595
doubleToLongBits( ), 463
doubleToRawBits( ), 463
do/while statements, 49
drainTo( ) (Queue), 235
DSA encryption algorithm, 365
DSA, RSA and EC public and private keys, 707, 712
DSAKey interface, 708
DSAKeyPairGenerator interface, 708
DSAParameterSpec interface, 714
DSAParams interface, 709
DSAPrivateKey interface, 709
DSAPrivateKeySpec interface, 714
DSAPublicKey interface, 709
DSAPublicKeySpec interface, 714
DTD (Document Type Definition), 1037
DTDHandler interface (SAX), 277, 1055
duplicate( ) (ByteBuffer), 590
Duration class, 998
dynamic class creation, 286
dynamic class instantiation, 72
dynamic class loading, 285
security risks, 299
dynamic method lookup, 121, 122
abstract methods, 130
E[ Top ]
ECPublicKey interface, 710
ECPublicKeySpec class, 717
editors, text, 8
Effective Java Programming Language Guide, 133, 190
element( ) (Queue), 235
Element interface (DOM), 279, 1042
element type, 74
elementAt( ) (Vector), 824
elements( )
Hashtable class, 788
Permissions class, 667
Vector class, 824
elements of an array, 12, 74
accessing, 78
ellipsis (...), in variable-length argument lists, 69
elliptic curve public keys, 710
EllipticCurve class, 717
else clause (if/else statements), 45
else if clause, 45
emacs text editor, 8
empty collections, 237, 768
empty interfaces, 139
empty statements, 43
emptyMap( ), 231
EmptyStackException, 774
encapsulation of data, 99, 123-128
access control, 124-127
inheritance and, 126
enclosing classes (see containing classes)
encode( )
Charset class, 629, 630
CharsetDecoder class, 634
CharsetEncoder class, 267, 633
CoderMalfunctionError, 633
EncodedKeySpec interface, 718
encodeLoop( ), 633
encoding and decoding text, 267
encoding/decoding data
CertPath encodings, 688
charsets, 586, 628-637
Unicode, 18
encoding of a certificate chain, 686
javadoc output, 343
tool for, 366
Unicode strings to/from bytes, 204
URLDecoder class, 585
URLEncoder class, 585
(see also charsets)
EncryptedPrivateKeyInfo class, 927
encryption/decryption of data (see cryptography; SSL)
end users, security for, 305
endorsed standards, 89
endsWith( ) (String), 492
enforcing method preconditions, 63
engineSetMode( ) (CipherSpi), 926
engineSetPadding( ) (CipherSpi), 926
enhanced for statement (see for/in statements)
enqueue( ) (Reference), 527
ensureCapacity( )
ArrayList class, 758
Vector class, 825
enterprise packages of Java, 204
Entity interface (DOM), 1043
EntityReference interface (DOM), 1044
EntityResolver interface (SAX), 277, 1056
EntityResolver2 interface (SAX), 1067
entries( ), 918
JarFile class, 872
entry in a keystore, 660
private key, 661
Entry interface (Map), 231, 232, 802
entrySet( )
AbstractMap class, 755
Map interface, 801, 802
SortedMap interface, 815
Enum class, 178
enum constants, 179
enum keyword, 179
EnumConstantNotPresentException, 465
enumerate( ) (ThreadGroup), 505
enumerated types, 159, 178-191, 225
annotations and, 198, 511
as classes, 179
Class methods supporting, 456
DatatypeConstants.Field, 997
DateFormat.Field, 736
defined, 179
ElementType, 513
Enum class, 181, 440, 464
enum syntax, advanced, 185-190
class body, 185
implementing an interface, 186
restrictions on enum types, 189
value-specific class bodies, 186-189
EnumMap, 182, 751
EnumSet, 183-185, 751
features of, 179
fields of, 534
Formatter.BigDecimalLayoutForm, 785
java.net package, 550
KeyRep.Type, 657
local scope and, 148
MemoryType, 522
nonstatic member classes and, 145
NumberFormat.Field, 745
Proxy.Type class, 568
RetentionPolicy, 514
RoundingMode class, 548
SSLEngineResult.HandshakeStatus, 957
SSLEngineResult.Status, 958
static member import declarations, 93
switch statement and, 181
Thread.State, 239, 504
TimeUnit, 221, 241, 854
typesafe enum pattern, 190
enumerated values, 179
enumeration implemented with anonymous class, 151
Enumeration interface, 774
Iterator interface vs., 793
EnumMap class, 182, 225, 233, 751
enums (see enumerated types)
EnumSet class, 183-185, 225, 228, 751
factory methods for initializing enumerated values, 184
restrictions on, 227
environment( ) (ProcessBuilder), 483
environment variables
CLASSPATH, 94
java, 338
javac compiler, 342
javadoc, 348
platform-dependent, 501
EOFException, 57, 396
eolIsSignificant( ), 433
epoch, 221
equality operators, 29, 35
comparing objects with = =, 85
return type, 31
equals( ), 85, 821, 822, 826
Annotation interface, 512
Arrays class, 79, 224, 759
ByteBuffer class, 591
Charset class, 630
Collection interface, 226
Comparator class, 461
Date class, 222
Enum class, 464
enumerated types, 180
Hashtable class, 788
Object class, 132, 480
String class, 209, 492, 493
string comparison, 208
equalsIgnoreCase( ) (String), 492
error( ) (Validator), 1024
Error class, 57, 465
unchecked exceptions, 68
error messages, 58
error streams, system, 399, 500
ErrorHandler interface (SAX), 277, 1056
ErrorListener interface, 1008
ErrorManager class, 878
errors, 15
assertion, 60
in assertions, 64
DOMErrorHandler, 1038
java.lang.annotation package, 511
PrintWriter class, 426
(see also exceptions)
escape sequences
in char literals, 23
in regular expressions, 213
in string and char literals, 73
in string literals, 24
for Unicode characters, 19
EUC-JP charset (Japanese text), 267
evaluate( ) (XPath), 1026
evaluating expressions, 28
operator associativity and, 30
order of, 32
EventListener interface, 321
EventObject class, 321
events
Event class, 324
EventListener interface, 324, 776
EventObject class, 324, 777
JavaBeans model, 321
conventions for, 324
listeners for, registering, 323
PropertyChangeEvent class, 321
@exception javadoc tag, 315
exceptions, 15
bean property accessor methods, 322
catching and handling with jdb debugger, 354
causing run( ) method of a thread to exit, 502
checked, declaring, 68
classes, 57
Exception class, 57, 466
ExceptionInInitializerError, 466
finalizer methods, 113
handlers for, 57
handling with try/catch/finally statement, 58-60
indexed property accessor methods, 322
parameterized, 175
subclasses of Error, 57
subclasses of Exception, 57
subclasses of RuntimeException, 68
thread, 240
Throwable interface, 440, 507
throwing, 56, 66
uncaught, in threads, 505
unchecked, 68
Exchanger class, 249, 839
exclamation point (see !, under Symbols)
exclusive locks, 270, 608
Exclusive OR (see XOR operator)
exec( ) (Runtime), 310, 402, 484
executable JAR files, running programs from, 332
execute permission, 402
ExecutionException, 244, 839
Executor interface, 242, 839
ExecutorCompletionService class, 840
Executors class, 244, 840
ExecutorService interface, 243, 841
ExemptionMechanism class, 928
ExemptionMechanismException, 929
ExemptionMechanismSpi class, 929
exists( ) (File), 397
exit( )
Runtime class, 484
System class, 59, 500
exitValue( ) (Process), 482
exponential notation, 25
exponentiation functions, 217
expression statements, 42
expressions, 13, 14, 18
addition, combining with string concatenation, 33
anonymous class definitions as, 151
assertion, 60, 61
side effects of, 63
comma-separated list, 76
evaluating in loops, 14, 48
continue statement and, 55
initializing and updating loop variables, 50
jdb syntax, 353
operators and, 28-41
( ) (parentheses), use of, 30
operator precedence, 30
order of evaluation, 32
summary of Java operators, 28-29
(see also operators)
extcheck utility, 327
extending a class, 99, 114-116
enumerated types and, 181
top-level class extending member class, 146
extending interfaces, 136
extensions, 1
standard, portability and, 311
external processes, communicating with, 295
Externalizable interface, 316, 397
F[ Top ]
\f (form feed), 23
factorials, computing (example program), 7-16
FactoryConfigurationError, 1004
FailedLoginException, 990
false values (boolean), 22
fatalError( ) (Validator), 1024
feature (doc comment cross-references), 318
fields
accessible to local classes, 149
atomic operations on (without locking), 252
class, 100, 529
hiding, 124
initializing, 106
DateFormat.Field class, 736
declaration syntax, 101
defaults and initializers, 109-111
deprecated (@deprecated javadoc tag), 315
deserializing, 412
enumerated types, 185
initializers, 190
Field class, 534
getGenericType( ), 529
DatatypeConstants, 997
FieldPosition class, 740
Format.Field class, 742
inheritance in subclassing, 115
inherited, initializing, 116
instance, 100, 103
inheritance of, 126
MessageFormat.Field, 743
named fields read by ObjectInputStream, 413
naming and capitalization conventions, 309
NoSuchFieldError, 477
NoSuchFieldException, 478
NumberFormat.Field, 745
ObjectStreamField class, 419
PutField class, 416
reference index, 1077-1146
references to, in @see javadoc tag, 319
fields (continued )
serialPersistentFields, 316
static, final, in interfaces, 135
static modifier, 157
superclass, hiding, 119
method overriding vs., 121
System.out.println( ), 106
transient, 157
volatile, 157
File class, 252, 397-399
enhancement in Java 1.2, 253
list( ), 152
file compression (see compression)
file pointer, 270
file: protocol, 258
file separators, 326
file structure, 93
FileChannel class, 268-270, 607
file locks, exclusive and shared, 270
MapMode class, 610
memory mapping a file, 269
random access to file contents, 270
FileDescriptor class, 399
sync( ), 436
FileFilter interface, 400
FileHandler class, 879
FileInputStream class, 252, 385, 400
SecurityManager and, 302
FileLock class, 610
OverlappingFileLockException, 614
FileLockInterruptedException, 611
FilenameFilter interface, 152, 385, 401
filenames, 9
hardcoded, portability and, 311
FileNotFoundException, 401
FileOutputStream class, 385, 401
FilePermission class, 402
FileReader class, 403
files, 252
associated with unused objects, closing or deleting, 113
binary, reading, 255
class, 94
compressed, reading, 256
compressing data, 255
FileNameMap interface, 558
FileNotFoundException, 68
filtering a list of, 400
filtering filenames, 401
handle to open file, 399
I/O, 268-270
nonstream classes, java.io, 385
not found, 401
permission to access, 402
RandomAccessFile class, 429
reading binary data from arbitrary locations in, 253
reading bytes from specified file, 400
reading text from, 403
reading to and writing from, 385
text, reading, 254
transforming to URIs, 397
writing data to specified file, 401
writing text to, using FileWriter, 403
ZipFile class, 918
FileWriter class, 403
fill( )
Arrays class, 224, 759
Collections class, 768
Filter interface, 880
filtering
character input streams, 405
input and output streams, 386
FilterInputStream class, 385, 404
CheckedInputStream class, 910
FilterOutputStream class, 385, 404
FilterReader class, 254, 405
FilterWriter class, 406
final modifier, 156
abstract modifier and, 129
class fields, 102
classes, 100, 116
enumerated types and, 181, 190
fields, 101
for/in loop variables, 51
in variable declarations, 44
in local method definitions, 148
local classes and, 149
method lookup, 122
methods, 67
finalize( ), 113, 480
finalizing objects, 111-114
finalizers, 113
chaining, 118
finally clause, 59
findClass( ) (ClassLoader), 459
findMonitorDeadlockedThreads( ), 525
first( )
CharacterIterator interface, 730
SortedSet interface, 816
first-in, first-out (FIFO) queues, 234
firstKey( )
SortedMap interface, 815
TreeMap class, 233
flags
format, illegal combination of, 791
format, mismatch with conversion specifier, 777
format specifier, 783
FormattableFlags class, 778
login module, 988
flip( ), 266
Buffer class, 588
FloatBuffer class, 595
floating-point types, 25, 204
arbitrary-precision decimal arithmetic, 218, 543
BigDecimal class, 218
comparing two operands of different types, 35
conversions, 27
decimal precision, IEEE 754R standard, 547
division, 33
double, 12, 22
Double class, 26, 439, 462
float, 22, 25
conversions, 28
Float class, 26, 217, 439, 467
formatting numbers, 220
Math class methods, 476
modulo (%) operator and, 33
strictfp methods, 67
strictfp modifier, 157
wrapper classes, 26
floatValue( ), 467
flow control statements, 13, 42
return statement, 13, 15
flush( )
BufferedOutputStream class, 388
CharArrayWriter class, 392
CipherOutputStream class, 926
DataOutputStream class, 396
Flushable interface, 386, 406
OutputStream class, 420
PrintWriter class, 426
StringWriter class, 435
Writer class, 437
Flushable interface, 386, 406
for each statement (see for/in statements)
for statements
continue statement, starting new iteration, 55
continue statement used in, 60
empty loop body, 43
initializing, testing, and updating variables, 49
iterating arrays, 78
force( ) (FileChannel), 608
forClass( ) (ObjectStreamClass), 417
forDigit( ) (Character), 448
for/in statements, xvii, 50-54, 159
example, 52
Iterable and Iterator interfaces, 52
Iterable interface, 225, 473
iterator( ), 440
iterating arrays, 79
limitations of, 53
syntax of, 51
form feed (\f), 23
format( ), 69, 386, 424, 426
Format class, 741
Formatter class, xviii, 211
formatting numbers, 220
MissingFormatArgumentException, 803
NumberFormat class, 744
PrintStream and PrintWriter classes, 211
String class, 211, 223
Format class, 741
format specifiers, 780
Format.Field class, 742
FormatFlagsConversionMismatch-Exception, 777
Formattable interface, 211, 778
FormattableFlags class, 778
Formatter class, xviii, 69, 211, 223, 386, 440, 751, 779-785
argument specifier, 782
conversion exception, 790
flags, 783
illegal combination, 791
format string and format specifiers, 779-782
IllegalFormatException, 791
logging, 881
missing format arguments, 803
precision, format specifier, 784
exception, 791
printf( ) and format( ), 312
Formatter class (continued )
SimpleFormatter, 890
unknown conversion specifier, 822
unknown format flags, 823
width, format specifier, 783
illegal, 792
missing, 803
XMLFormatter, 891
Formatter.BigDecimalLayoutForm, 785
FormatterClosedException, 785
formatToCharacterIterator( ), 741, 743
forName( )
Charset class, 636
Class class, 455, 458
UnicodeBlock class, 452
forward references, 96
fractions, decimal representation of, 219
freeMemory( ), 484
from( ) (MemoryNotificationInfo), 521
ftp: protocol, 258
fully qualified class names, 89, 332
importing types, 90
functions, 17
mathematical, 217
XPath, 1030
Future interface, 244, 843
CancellationException, 832
ScheduledFuture, 848
FutureTask class, 844
G[ Top ]
garbage collection, 86, 96, 111
disabling for classes, 336
finalize( ) method, 480
incremental, interpreter option for, 336
jdb debugger, 355
OutOfMemoryError, 480
printing message upon occurrence, 337
statistics on (jstat), 361
system, 500
WeakHashMap class, 826
(see also references)
GarbageCollectorMXBean interface, 519
GatheringByteChannel, 266, 611, 615
gc( ), 484
gcd( ) (BigInteger), 546
GeneralSecurityException, 650
generateCertificate( ), 686, 702
generateCertificates( ), 686
generateCertPath( ), 686
generateCRL( ), 686, 705
generateKey( ) (KeyGenerator), 932
generateKeyPair( ), 708
generateParameters( ), 643
generatePrivate( ), 654
generatePublic( ), 654
generateSecret( )
KeyAgreement class, 930
SecretKeyFactory class, 937
generateSeed( ) (SecureRandom), 675
generic types, xviii, 160-178, 526-529
annotation types and, 200
arrays of parameterized type, 166
bounded wildcards in parameterized types, 168
case study, Comparable and Enum, 176-178
Class class, 455
collection interfaces and classes, 751
compile-time type safety, 165
Constructor class, 533
covariant returns, 70
Enum class, 464
Exchanger, 249, 839
Field class, support of, 534
FutureTask, 844
generic methods, 65
GenericDeclaration, 535
generics, defined, 159
GenericSignatureFormatError, 535
InheritableThreadLocal class, 471
interfaces extending Type, 541
MalformedParameterizedType-Exception, 537
Method class, support for, 538
parameterized type hierarchy, 164
parameterized types vs., 160
PhantomReference class, 526
PrivilegedAction, 669
raw types and unchecked warnings, 163
Reference class, 527
ReferenceQueue class, 527
Reflection API, changes in, 529
runtime type safety, 165
SoftReference class, 528
ThreadLocal class, 507
type parameter wildcards, 166-169
typesafe collections, 160-163
TypeVariable interface, 541
understanding, 163
WeakReference class, 528
writing, 169-172
type variable bounds, 170
wildcards, 171
writing generic methods, 172-176
arrays and, 175
invoking methods, 173
parameterized exceptions, 175
GenericArrayType interface, 535
GenericDeclaration interface, 529, 535
generics (see generic types)
genKeyPair( ) (KeyPairGenerator), 656
get( ), 252
AbstractList class, 754
Array class, 531
ArrayList class, 758
Buffer class, 587
ByteBuffer class, 589
Calendar class, 763
Future class, 244
GetField class, 414
HashMap class, 786
Hashtable class, 788
LinkedList class, 795
List interface, 229, 797
Map interface, 231, 801
PhantomReference class, 526
Reference class, 527
ReferenceQueue class, 528
ThreadLocal class, 507
TreeMap class, 820
WeakHashMap class, 826
get and set accessor methods
data accessor methods, 128
JavaBean properties, 321-323
getAbsoluteFile( ) (File), 397
getAbsolutePath( ) (File), 397
getActualTypeArguments( ), 539
getAddress( ) (InetAddress), 562
getAlgorithm( ) (Key), 653
getAllAttributeKeys( ), 725
getAllByName( ) (InetAddress), 562
getAllLoadedClasses( ) (Instrumentation), 517
getAllStackTraces( ), 503
getAllThreadIds( ), 525
getAnnotation( ), 199, 456
getAnnotations( ), 531
getAttribute( )
AttributedCharacterIterator, 725
TransformerFactory class, 1013
getAttributes( )
AttributedCharacterIterator interface, 725
JarEntry class, 871
Manifest class, 874
getBeginIndex( ) (FieldPosition), 740
getBlockedCount( ) (ThreadInfo), 524
getBlockedTime( ) (ThreadInfo), 524
getBody( )
CacheRequest class, 553
CacheResponse class, 553
getBounds( ) (TypeVariable), 541
getBuffer( ) (StringWriter), 435
getByAddress( ) (Inet6Address), 561
getByName( ) (InetAdress), 562
getCanonicalFile( ) (File), 397
getCanonicalPath( ) (File), 397
getCause( ) (Throwable), 437, 466
getCertificate( ) (KeyStore), 658
getCertificateChain( ) (KeyStore), 658
getCertificates( )
CertPath class, 688
JarEntry class, 871
getCertPathEncoding( ), 686
getChannel( ), 268, 400, 401, 429, 556
ServerSocket class, 571
Socket class, 573
getChars( ), 493
StringBuffer class, 496
getCipherSuite( ) (SSLSession), 962
getClass( )
Class class, 455
Object class, 479
getClassName( ), 489
getClientSessionContext( ), 964
getCollationElementIterator( ), 731
getCollationKey( ), 732
getColumnNumber( ), 1010
getCommitted( ) (MemoryUsage), 523
getConstructor( ) (Class), 533
getContent( )
URL class, 554, 581
URLConnection class, 554
getContentEncoding( ), 583
getContentLength( ), 583
getContentType( ), 583
getContext( ) (AccessController), 641, 642
getDate( ) (URLConnection), 583
getDateInstance( ) (DateFormat), 734
getDeclaredAnnotations( ), 531
getDeclaringClass( )
Enum class, 464
Field class, 534
Member interface, 537
Method class, 536
getDefault( )
CookieHandler class, 554
ResponseCache class, 569
ServerSocketFactory class, 946
SocketFactory class, 947
SSLServerSocketFactory class, 962
getDefaultPort( ) (URL), 581
getDefaultText( ), 981
getDelay( ) (ScheduledFuture), 244
getDelegatedTask( ) (Runnable), 956
getDirectionality( ) (Character), 448
getDisplayName( ), 566
getEnclosingClass( ), 456
getEnclosingConstructor( ), 456
getEnclosingMethod( ), 456
getEncoded( )
AlgorithmParameters class, 644
Certificate class, 683
CertPath, 688
Key interface, 653
getEncoding( ), 407, 421
getEncodings( ) (CertPath), 688
getEndIndex( ) (FieldPosition), 740
getEntries( ) (Manifest), 874
getEntry( )
KeyStore class, 658
ZipFile class, 918
getEnumConstants( ), 456
getenv( ) (System), 310, 501
getErrorStream( ) (Process), 482
getException( ), 466
PrivilegedActionException, 670
getExceptionTypes( ) (Method), 537
getExpiration( ), 583
getFD( ), 399
getField( )
Class class, 534
ObjectStreamClass, 417
GetField class, 413
getFields( ) (ObjectStreamClass), 417
getFile( ) (URL), 580
getFormat( )
Key interface, 653
SecretKey interface, 936
getGenericComponentType( ), 535
getGenericDeclaration( ), 541
getGenericExceptionTypes( ), 538
getGenericParameterTypes( ), 538
getGenericReturnType( ), 538
getGenericType( ) (Field), 534
getHeaderField( ), 583
getHeaderFieldDate( ), 583
getHeaderFieldInt( ), 583
getHeaderFields( ), 583
getHeaders( ), 553
getHost( ) (URL), 580
getHostAddress( ) (InetAddress), 562
getHostName( ) (InetAddress), 562
getId( ) (Thread), 502
getID( ) (TimeZone), 819
getIds( ), 964
getInetAddress( )
DatagramSocket class, 556
ServerSocket class, 570
Socket class, 572
getInetAddresses( ), 566
getInfo( ) (Provider), 671
getInit( ) (MemoryUsage), 523
getInitiatedClasses( ) (Instrumentation), 517
getInputStream( )
JarFile class, 872
Process class, 482
Socket class, 572
ZipFile class, 918
getInstance( )
AlgorithmParameterGenerator, 643
Calendar class, 785
CertificateFactory class, 686
CertStore class, 694
Cipher class, 923
Collator class, 733, 747
KeyAgreement class, 930
KeyGenerator class, 932
KeyManagerFactory class, 952
KeyPairGenerator class, 656, 708
KeyStore class, 658
Mac class, 933
MessageDigest class, 663
NumberFormat class, 744
SecretKeyFactory class, 936
SecureRandom class, 675
Signature class, 677
getInt( ) (Array), 531
getInteger( ) (Integer), 472
getInterfaces( ) (Class), 455
getInvocationHandler( ) (Proxy), 540
getIterator( ) (AttributedString), 727
getIV( ) (Cipher), 923
getJarEntry( ) (JarFile), 872
getKey( )
Entry interface, 802
KeyStore class, 658
getKeyManagers( ), 952
getKeySpec( )
KeyFactory class, 654
SecretKeyFactory class, 937
getLineNumber( )
LineNumberReader class, 410
SourceLocator, 1010
getLocalAddress( )
DatagramSocket class, 556
Socket class, 572
getLocalHost( ) (InetAddress), 562
getLocalPart( ) (QName), 1001
getLocalPort( )
DatagramSocket class, 556
ServerSocket class, 570
Socket class, 572
getLocalSocketAddress( )
DatagramSocket class, 556
ServerSocket class, 570
Socket class, 572
getLocation( ), 71
getLogger( ) (Logger), 212
getLong( ) (Long), 474
getLowerBounds( ) (WildcardType), 542
getMacLength( ) (Mac), 933
getMainAttributes( ) (Manifest), 874
getManifest( )
JarFile class, 872
JarInputStream class, 873
getMax( ) (MemoryUsage), 523
getMaxAllowedKeyLength( ), 923
getMemoryPoolNames( ), 521
getMessage( ), 58, 408
TextOutputCallback, 981
Throwable interface, 507
WriteAbortedException, 437
getMessageType( ) (CallbackHandler), 978
getMethod( ) (Class), 537
getMethodName( ), 489
getModifiers( ), 539
Field class, 534
Member interface, 537
getModulus( ) (RSAKey), 710
getName( )
Class class, 455
CompilationMXBean interface, 519
Field class, 534
File class, 397
Member interface, 537
MemoryPoolMXBean, 522
NetworkInterface class, 566
Provider class, 671
TypeVariable interface, 541
getNamespaceURI( ) (QName), 1001
getNetworkInterfaces( ), 566
getNextEntry( ), 873
getNextJarEntry( ), 873
getNextUpdate( ) (X509CRL), 705
getNumericValue( ) (Character), 448
getObject( )
GuardedObject class, 650
SealedObject class, 935
SignedObject class, 679
getObjectSize( ) (Instrumentation), 517
getObjectStreamClass( ) (GetField), 414
getOffset( ) (TimeZone), 819
getOption( ) (SocketOptions), 576
getOutputProperties( ), 1010
getOutputSize( ) (Cipher), 924
getOutputStream( ), 559
Process class, 482
Socket class, 572
getOwnerType( ) (ParameterizedType), 539
getPackage( )
ClassLoader class, 459
Package class, 481
getPackages( ) (Package), 481
getParameterAnnotations( ), 198, 538
getParameters( ) (Cipher), 923
getParameterTypes( ) (Method), 537
getParams( ) (DHKey), 938
getParent( )
File class, 397
ThreadGroup class, 506
getParentFile( ) (File), 397
getPassword( )
KeyStore.PasswordProtection, 661
PasswordAuthentication, 567
getPasswordAuthentication( ), 551, 567
getPath( ) (File), 397
getPeakUsage( ), 522
getPeerCertificateChain( ), 950
getPeerCertificates( ), 950, 962
getPeerHost( ), 951, 962
getPermissions( )
Policy class, 668
SecureClassLoader class, 674
getPolicy( ) (Policy), 668, 677
getPort( )
DatagramSocket class, 556
Socket class, 572
URL class, 581
getPrefix( ) (QName), 1001
getPrivateKey( ), 661
getPrompt( )
CallbackHandler class, 978
NameCallback class, 980
TextInputCallback class, 981
getProperties( ) (System), 500
getProperty( )
Properties class, 806
System class, 293, 500, 807
getProtectionDomain( ) (Class), 671
getProtocol( )
SSLSession class, 962
URL class, 580
getProvider( ) (Security), 676
getProviders( ) (Security), 676
getProxyClass( ) (Proxy), 540
getPublicId( ) (SourceLocator), 1010
getPublicKey( )
Certificate class, 683
X509Certificate class, 702
getRaw( ) (URI), 579
getRawType( ) (ParameterizedType), 539
getRemoteSocketAddress( ), 572
getRequesting( ), 551
getResource( ) (ClassLoader), 458
getResourceAsStream( ), 458
getResources( ) (ClassLoader), 458
getResponseCode( ), 559
getResponseMessage( ), 559
getReturnType( ) (Method), 537
getRevokedCertificate( ), 705
getRunLimit( ), 726
getRunStart( ), 726
getRuntime( ), 484
getSecretKey( ), 662
getSecurityManager( ) (System), 501
getSerialVersionUID( ), 417
getServerSessionContext( ), 964
getServerSocket( ), 961
getServerSocketFactory( ), 954
getSimpleName( ) (Class), 456
getSocketFactory( ), 954
getSource( ) (EventObject), 777
getSpecificationVersion( ), 481
getStackTrace( )
Thread class, 503
Throwable interface, 489
getState( ) (Thread), 502, 504
getSubject( ) (LoginContext), 974, 985, 991
getSubjectDN( ) (X509Certificate), 683, 702
getSuperclass( ) (Class), 455
getSupportedCipherSuite( ), 965
getSupportedProtocols( ), 965
getSystemId( ) (SourceLocator), 1010
getTargetException( ), 536
getThisUpdate( ) (X509CRL), 705
getThreadCPUTime( ), 525
getThreadGroup( ) (Thread), 502
getThreadInfo( ), 525
getThreadUserTime( ), 525
getTime( ), 222
getTimestamp( ) (Timestamp), 680
getTrustAnchor( ), 699
getTrustedCertificate( ), 662
getType( )
CertPath class, 688
Character class, 448
Field class, 534
MemoryPoolMXBean, 522
getTypeParameters( ), 535
getUndeclaredThrowable( ), 542
getUpperBounds( ) (WildcardType), 542
getUptime( ) (RuntimeMXBean), 524
getUsage( ), 522
getUsed( ) (MemoryUsage), 523
getValue( )
Entry interface, 802
SSLSocket, 962
getVersion( ) (Provider), 671
getX( ) (DHPrivateKey), 938
getXMLReader( ) (SAXParser), 1005
getY( ) (DHPublicKey), 939
global method or function, class methods as, 103
global variables
C language vs. Java, 96
public class fields as, 102
GMT (Greenwich Mean Time), 221
goto statement, 96
graphical Java process monitor, 352
graphics
applet access control restrictions on facilities, 302
packages for, 204
greater than operator (>), 14, 35
greater than or equal operator (>=), 35
green threads, 333, 335
Greenwich Mean Time (GMT), 221
Gregorian calendar, 222
GregorianCalendar class, 785
group of threads (ThreadGroup class), 505
groups (multicast), joining and leaving, 565
Guard interface, 650
GuardedObject class, 639, 650
GUI (graphical user interface)
applet access to, restrictions, 302
packages for, 204
gzip compression, 751
pack200 tool, 366
unpacking files with unpack200, 371
GZIPInputStream class, 914
GZIPOutputStream class, 915
H[ Top ]
Han (Chinese) ideographs, 23
hand-held devices
Java 2 Platform, Micro Edition (J2ME), 4
Java interpreter for, 2
handle( ) (CallbackHandler), 977, 982
handle to an open file or socket, 399
Handler class, 881
HandlerBase interface (SAX), 1057
handlers for exceptions, 56
try/catch/finally statements, 58-60
handshake, SSL connections, 965
status of the SSLEngine, 957
handshakeCompleted( ), 950
HandshakeCompletedEvent class, 950
HandshakeCompletedListener interface, 950
hardcoded filenames, code portability and, 311
hashCode( )
Annotation interface, 512
Enum class, 464
enumerated types, 180
Hashtable class, 788
Object class, 133, 480
HashMap class, 225, 233, 786
HashSet class, 228, 787
hashtables
causing memory leaks, 112
Hashtable class, 233, 788
Properties subclass, 293
maps and sets based on, 225
WeakHashMap class, 529
hasNext( ), 756
Iterator class, 753
Iterator interface, 52, 793
ListIterator interface, 798
hasPrevious( ) (ListIterator), 756, 798
header and source files (C), 348
header files for use with JNI, 349
headMap( ) (SortedMap), 234, 815
headSet( ) (SortedSet), 816
heap
memory allocation for, 336
memory usage information, 521
Hebrew text, 728
help
javadoc-generated documentation, 344
javap tool, 350
hexadecimal numbers, 24
Integer type conversions, 472
Long type conversions, 474
Short type conversions, 488
URL encoding, 585
hiding data, 123-128
access control, 124-127
inheritance and, 126
superclass fields, 119
class fields, 119
method overriding vs., 121
hierarchy, class, 87
containment hierarchy vs., 147
parameterized types, 164
superclasses, Object class and, 116
highestOneBit( ) (Integer), 472
holdsLock( ) (Thread), 63, 502
HostnameVerifier class, 951
hosts
IP addresses, 562
NoRouteToHostException, 567
reachability of, testing, 263, 562
UnknownHostException, 578
HotSpot VM
client and server versions, 332
performance tuning options, 335
HTML tags in doc comments, 312, 313
<A> (hyperlinks) tag, avoiding, 313
<PRE> tag, 313
http: protocol, 258
HTTP server, 261
HttpRetryException, 559
https: protocol, 258
https: URLs, 948
HttpsURLConnection class, 948, 951
hostname verifier, 951
HttpURLConnection class, 559
hyperbolic trigonometric functions, 476
hyperlinks or cross-references in doc comments, 313
I[ Top ]
IANA charset registry, 630
identical objects, 85
identifiers
assert, 61
class version, 417
defined, 20
method names, 66
SSLSession, 964
thread, 502
TimeZone, 819
UUID (Universal Unique Identifier), 823
identity certificates (see certificates)
Identity class, 651
identityHashCode( ) (System), 464, 501
IdentityHashMap class, 225, 233, 789
IdentityScope class, 652
IEEE 754-1985 standard for floating-point types, 25
if statements, 13
assertions in, 62
if/else statements, 44-46
else if clause, 45
nested, 45
IllegalAccessError, 468
IllegalAccessException, 468
IllegalArgumentException, 468
IllegalBlockingModeException, 611
IllegalBlockSizeException, 929
IllegalCharsetNameException, 635
IllegalClassFormatException, 516
IllegalFormatCodePointException, 790
IllegalFormatConversionException, 790
IllegalFormatException, 791
IllegalFormatFlagsException, 791
IllegalMonitorStateException, 469
IllegalSelectorException, 612
IllegalStateException, 469
IllegalThreadStateException, 470
images in doc comments, 313
immutability of String objects, 205
implementation
behavior specific to, portability and, 311
bugs specific to, portability and, 311
local and anonymous class, 155
member class, 155
of methods, 65
portable Java code, conventions/rules for, 310
static member types, 154
implements (keyword), 99, 136
implies( ), 304
AllPermission class, 645
BasicPermission class, 646
CodeSource class, 647
Permission class, 666
PermissionCollection class, 667
Permissions class, 667
ProtectionDomain class, 671
import declarations, 18, 91
naming conflicts and shadowing, 91
static members, 92
import static declaration, xvii, 143, 184
importPreferences( ), 295
in, out, and err variables, 399, 500
IncompatibleClassChangeError, 470
increment expression statements, 42
increment operator (++), 29, 34
return type, 31
side effects, 32
incrementing loop counter variable, 48
inDaylightTime( ) (TimeZone), 819
indentation, 19
anonymous class definitions, 154
in doc comments, code examples and, 313
nested statements, 13, 45
index( ), 756
index operator ([ ]), 75
indexed properties, 321
conventions for, 322
indexes
array, 41, 74
too small or too large, 78
generating multiple index files, javadoc, 347
javadoc, not generating, 345
list, 229
indexOf( )
CopyOnWriteArrayList, 835
List interface, 229, 797
String class, 492
StringBuffer class, 496
indexOfSubList( ) (Collections), 768
IndexOutOfBoundsException, 470
Inet4Address class, 561
Inet6Address class, 561
InetAddress class, 562
isReachable( ), 263, 562
InetSocketAddress class, 271, 563
infinite loops, 48
for(;;), 50
infinity
% (modulo) operator and, 33
Double, testing for, 462
positive and negative, 26
Inflater class, 915
InflaterInputStream class, 916
info( ) (Logger), 212
InheritableThreadLocal class, 470
inheritance
access control and, 126
{@inheritDoc} javadoc tag, 317
@Inherited meta-annotation, 202
interfaces
as alternative to multiple inheritance, 135
constants in definitions, 139
extending interfaces, 136
scope vs., for member classes, 147
subclass from superclass, 99
subclasses and, 114-123
class hierarchy, 116
constructor chaining and the default constructor, 117
fields and methods, 115
hiding superclass fields, 119
overriding superclass methods, 120-123
subclass constructors, 116
@Inherited meta-annotation, 202, 514
inheritedChannel( ), 501
init( )
Cipher class, 923
KeyAgreement class, 930
KeyGenerator class, 932
KeyManagerFactory class, 953
Mac class, 933
PKIXCertPathChecker class, 699
initialization vectors (Cipher), 923, 942
initialize( ) (KeyPairGenerator), 656, 708
initializers, 106-111
array, 76
multidimensional arrays, 81
defining a constructor, 107
defining multiple constructors, 108
enumerated types, 190
ExceptionInInitializerError, 466
field, 109-111
IllegalAccessException, 468
in variable declarations, 43
inherited fields, 116
instance, 111
invoking one constructor from another, 108
static, 110, 157
initializing loop variables, 49
initialValue( ) (ThreadLocal), 507
initSign( ) (Signature), 677
initVerify( ) (Signature), 677
inline tags (doc comment), 316
inner classes (see nested types)
InputMismatchException, 792
input/output, 203
appendability of text buffers and output streams, 207
binary file, reading, 255
character stream classes, 386
checksums for streams, 910
Closeable interface, 386, 393
compressed files, reading, 256
compressing data, 255
console input, reading, 254
displaying output, 12
encrypting and decrypting streams, 292
files and directories, 252-254
files, working with, 268
filtering bytes, 385
Flushable interface, 386, 406
GZIPInputStream class, 914
GZIPOutputStream class, 915
input/output (continued )
in, out, and err streams, system, 500
InflaterInputStream class, 916
input values, checking validity of, 13
JAR files, reading and writing, 330, 873
Java program communicating with external process, 295
java.io package, 203, 254-258, 385-438
keytool program, 365
message digests, 639, 648
message digests, computing, 256
New I/O API (see New I/O API
nonstream classes, 385
processes, 482
profiling output, printing to standard output, 337
reading lines from a text file, 254
serializing/deserializing objects, 286
streaming data to and from arrays, 257
text file, reading lines from, 254
thread blocking during I/O operations, 250
thread communication with pipes, 257
writing text to a file, 255
XML, transformation classes for, 280
ZipInputStream class, 919
ZipOutputStream class, 919
InputSource class (SAX), 1058
InputStream class, 385, 407
read( ), 385
InputStreamReader class, 407
insert( ) (StringBuffer), 496
insertProviderAt( ) (Security), 672, 676
instance fields, 103
default initialization of, 109
interfaces and, 135
superclass, hiding, 119
instance initializers, 111
substituting for constructors, 153
instance members, 100
enumerated types, ordinal( ), 180
inheritance of, 126
instance methods, 100, 104-106
choosing between class and instance methods, 105
how they work, 104
interfaces, 135
overriding superclass methods, 120-123
synchronized, 56
System.out.println( ), 106
instanceof operator, 29, 40, 133
marker interfaces, identifying with, 139
instances, class
comparing with Comparable.compareTo( ), 133
creating dynamically, 72
enumerated types, 180
instantiating a class, 98
InstantiationError, 471
InstantiationException, 471
instrumentation, xviii, 203, 296-298, 515-518
ClassDefinition class, 516
ClassFileTransformer interface, 516
IllegalClassFormatException, 516
Instrumentation interface, 517
Java interpreter options, 336
java.lang.instrument package, 439
UnmodifiableClassException, 517
int type, 22, 24
32-bit int values, 25
bitwise and shift operator results, 37
conversion to other primitive types, 28
Integer class, 472
new methods in Java 5.0, 472
IntBuffer class, 596
integers
% (modulo) operator and, 33
arbitrary-precision arithmetic, 204, 543
BigInteger class, 218, 546
converting floating-point values to, using casts, 27
converting strings to, 25
int data type, 11
Integer class, 11, 25, 217, 439, 472
new methods, Java 5.0, 472
integer literals, 24
integer types, 24
array access ([ ]) operator and, 31
wrapper classes, 25
interest set of channel operations, 618
interestOps( ) (SelectionKey), 619
@interface annotation, 199
interfaces, 135-140
abstract classes vs., 138
abstract modifier in declarations, 156
as static member types, 140
classes implementing, definitions of, 99
as data types, 137
defined, 99
defining, 135
defining object types, 98
deprecated (@deprecated javadoc tag), 315
dynamic proxies, implementing with, 286
extending, 136
implemented by enumerated types, 181, 186
implementing, 136-138
multiple, 137
InstantiationError, 471
InstantiationException, 471
local scope and, 148
marker, 139
member classes, inability to define as, 145
modifiers, 156
naming and capitalization conventions, 309
network, 566
references to, in @see javadoc tag, 318
intern( ) (String), 209, 493
InternalError, 473
internationalization, 6, 751
applications, package for, 204
comparing strings, 209
date and time formatting, 223
InputStreamReader, byte-to-character conversions, 407
java.text package, 724-749
LanguageCallback class, 980
Locale class, 799
locale, specifying for documentation, 345
OutputStreamWriter class, 421
Internet domain names, using in package naming, 90
interpreted mode (JVM), 336
interpreter (see Java interpreter; JVM)
interrupt( )
Thread class, 241, 250, 502
ThreadGroup class, 506
interrupted( ) (Thread), 250, 502
InterruptedException, 250, 473
InterruptedIOException, 408, 556, 572
InterruptibleChannel interface, 250, 612
InvalidAlgorithmParameterException, 652
invalidate( ) (SSLSession), 962
InvalidClassException, 408
InvalidKeyException, 653
InvalidKeySpecException, 718
InvalidMarkException, 597
InvalidObjectException, 409, 414
InvalidParameterException, 653
InvalidParameterSpecException, 718
InvalidPreferencesFormat-Exception, 894
InvalidPropertiesFormatException, 792
InvocationHandler interface, 286, 529, 536
proxy class instances and, 540
InvocationTargetException, 536
invoke( )
InvocationHandler, 536, 540, 542
Method class, 538
invoking methods, 10, 11
class methods, 102
constructors, from another constructor, 108
in expression statements, 42
instance methods, 105
overridden, 122
IOException, 409
IP (Internet Protocol) addresses, 562
combined with a port number, 563
enumerating for network interface, 566
IPv4 (Internet Protocol version 4) addresses, 561
IPv6 (Internet Protocol version 6) addresses, 561
is prefix, data accessor methods, 128
isAbsolute( ) (File), 397
isAbstract( ) (Modifier), 539
isAlive( ) (Thread), 502
isAnnotation( ) (Class), 456
isAnnotationPresent( ) (AnnotatedElement), 198
isAnonymousClass( ), 456
isBound( )
DatagramSocket class, 556
ServerSocket class, 570
Socket class, 572
isCancelled( ) (Future), 244
isCompatibleWith( ) (Package), 481
isConnected( ) (Socket), 572
isCurrent( ) (Refreshable), 974
isDestroyed( ) (Destroyable), 972
isDigit( ) (Character), 23, 448
isDirect( ) (ByteBuffer), 591
isDirectory( ) (File), 397
isDone( ) (Future), 244
isEchoOn( ) (Password Callback), 980
isEmpty( )
Collection interface, 766
Map interface, 801
isEnqueued( ) (Reference), 527
isEnum( ) (Class), 456
isEnumConstant( ) (Field), 534
isError( ) (CoderResult), 634
isFile( ) (File), 397
isHidden( ) (File), 397
isInfinite( ) (Double), 462
isInputShutdown( ) (Socket), 572
isInterrupted( ) (Thread), 250, 502
isJavaIdentifierPart( ) (Character), 21
isJavaIdentifierStart( ) (Character), 21
isJavaLetter( ) (Character), 23
isLetter( ) (Character), 448
isLocalClass( ), 456
isLowerCase( ) (Character), 23, 448
isMalformed( ) (CoderResult), 634
isMemberClass( ), 456
isNaN( )
Double class, 26, 35, 462
Float class, 26, 35
isNativeMethod( ) (StackTraceElement), 490
ISO-8859-1 (Latin-1) charset, 18, 267
isOpen( ) (Channel), 603
isOutputShutdown( ) (Socket), 572
isProbablePrime( ) (BigInteger), 546
isProxyClass( ) (Proxy), 540
isPublic( ) (Modifier), 539
isReadOnly( ) (Buffer), 588
isRedefineClassesSupported( ) (Instrumentation), 517
isRegistered( )
Charset class, 630
SelectableChannel interface, 617
isRevoked( ) (CRL), 696, 705
isSealed( ) (Package), 481
isShared( ) (FileLock), 610
isSupported( ) (Charset), 629
isSynthetic( ) (Member), 537
isThreadCPUTimeSupported( ), 525
isUpperCase( ) (Character), 448
isUsageThresholdSupported( ), 522
isValid( )
FileLock class, 610
SSLSession class, 962
isVarArgs( ) (Method), 538
isWhitespace( ), 448
Iterable interface, 51, 52, 225, 440, 473
iterations, 15
arrays, 78
for/in statement, 50-54
in loops, starting new with continue statement, 54
lists, 230
(see also statements)
iterator( ), 440, 816
AbstractCollection class, 753
Iterable interface, 53
List interface, 230, 797
Set interface, 802
Iterator interface, 52, 143, 225, 793
getting Iterator objects, 473
implemented as an anonymous class, 151
IvParameterSpec class, 942
J[ Top ]
J2EE (Java 2 Platform, Enterprise Edition), 4
JAAS (Java Authentication and Authorization Service), 204, 970-993
Japanese text (EUC-JP charset), 268
JAR (Java Archive) files
classes for reading and writing, 869-877
compressed, unpacking with unpack200, 371
compression, pack200 tool, 366
digital signatures, 302
extcheck utility, 327
extension, checking whether installed, 327
java.util.jar package, 750
manifest, format of, 870
package for, 204
retrieving, 564
running programs, 95, 332
jar tool, 329-331
command options, 330
command syntax, 330
examples, 331
files, 331
modifier options, 330
JarEntry class, 869, 871
JarException, 872
JarFile class, 869, 872
JarInputStream class, 869, 873
JarOutputStream class, 869, 874
jarsigner tool, 328
JarURLConnection class, 564, 869
Java, 1-7
benefits of, 4-6
performance, 6
strong typing in, 11
versions, 3
1.1, security and, 300
Java 2 Platform
Enterprise Edition, 4
Micro Edition, 4
Java 5.0, xvii, 159-202, 561
annotation types
Deprecated, 462
Override, 481
SuppressWarnings, 499
annotations, 191-202, 203, 511-515
Appendable interface, 207, 386, 424, 440, 444
asList( ) (Arrays), 237
atomic operations, 855-862
BigDecimal class, changes to, 219
boxing and unboxing conversions, 88
changes to the Java platform, xviii
CharSequence, 496
Class class, 456
Closeable interface, 386, 393
collections wrapper methods, 236
ConcurrentHashMap class, 233
Condition object, 248
contentEquals( ), 208
CopyOnWriteArrayList class, 231
CountDownLatch class, 249
cross-references in doc comments, 318
cryptography
algorithms supported, SunJCE, 923
Cipher class, 923
KeyGenerator algorithms, 932
MAC algorithms, 933
OAEPParameterSpec, 942
PSource, 943
PSource.PSpecified, 944
SecretKeyFactory, 937
CyclicBarrier class, 250
debugger to VM connections, 353
DOM
bootstrap, events, and ls subpackages, 1032
Level 3, 1032
NameList interface, 1045
TypeInfo interface, 1050
UserDataHandler interface, 1050
DOMConfiguration interface, 1037
DOMError interface, 1038
DOMErrorHandler interface, 1038
DOMImplementationList interface, 1041
DOMLocator interface, 1041
DOMStringList interface, 1042
enumerated types, 178-191
Enum class, 181, 440, 464
SSLEngineResult.HandshakeStatus, 957
SSLEngineResult.Status, 958
executors framework, 242-244
Executor interface, 242
ExecutorService interface, 243
Future interface, 244
ScheduledExecutorService class, 244
ThreadPoolExecutor class, 243
Flushable interface, 386, 406
format( ), creating String objects, 491
Formattable interface, 778
FormattableFlags class, 778
Formatter class, 223, 386, 440, 779-785
generic types, 160-178, 225
Class class, 455
Exchanger, 249
java.lang.ref, 526-529
PrivilegedAction, 669
inheritedChannel( ), 501
Java 5.0 (continued )
instrumentation, 203, 296, 336, 515-518
Integer class, methods added, 472
Iterable interface, 225, 440, 473
java.util package, 751
java.util.concurrent package, 204, 827-855
jinfo, 357
jmap, 358
jsadebugd tool (remote debugging), 359
jstack tool, 360
jstat tool, 360-362
jstatd daemon, 362
locks, 246
Long class, additional methods, 474
management package, 203, 518-526
JMX API, 296
Matcher class, enchancements, 215
Math class, new methods, 218, 476
math package, changes to
BigDecimal class, 543
MathContext class, 547
rounding mode, 544
RoundingMode type, 548
MissingFormatArgumentException, 803
nanoTime( ) (System), 500
networking
Authenticator.Requestor-Type, 552
CacheRequest, 553
CacheResponse class, 553
CookieHandler class, 554
HttpRetryException, 559
isReachable( ), InetAddress, 263, 562
ProxySelector class, 569
Proxy.Type class, 568
ResponseCache class, 569
SecureCacheResponse, 570
URLConnection, changes to, 583
printf( ) and format( ), 210, 312, 424
formatting numbers, 220
PrintStream class, 386, 424
PrintWriter class, 386, 426
PriorityQueue class, 805
ProcessBuilder class, 295, 440, 482
Queue and BlockingQueue interfaces, 234, 251
Queue interface, 225, 808
Readable interface, 215, 440, 483
Reflection API, changes to, 529
AnnotatedElement, 531
Constructor class, 533
Field class, 534
generic type malformed, 537
GenericArrayType, 535
GenericDeclaration, 535
GenericSignatureFormat-Error, 535
Method class, 538
ParameterizedType, 539
Type interface, 541
TypeVariable interface, 541
WildcardType, 542
replace( ), generalized versions, 492
SAX2 extensions, 1064
Attributes2, 1065
Attributes2Impl, 1065
DefaultHandler2, 1066
EntityResolver2, 1067
Locator2, 1068
Locator2Impl interface, 1068
Scanner class, 215, 440, 811-813
input mismatch, 792
security
CodeSigner class, 647
KeyRep class, 657
KeyRep.Type, 657
KeyStore class, 658
KeyStore nested classes, 660-662
Provider.Service class, 673
Timestamp class, 680
UnrecoverableEntryException, 681
Semaphore class, 249
SSLEngine class, 948, 955
StringBuilder class, 498
System class, clearProperty( ), 500
System.getenv( ), 310
Thread class, 502
UncaughtExceptionHandler, 505
Thread.State enumerated type, 239
time in nanoseconds (System.nanoTime( )), 221
TimeUnit class, 221, 241
Unicode supplementary characters, 209
Character class methods, 448
String methods for, 493
Java 5.0 (continued )
UnicodeBlock class, 452
UUID class, 823
Writer class, changes to, 437
XML packages, 994-1001, 1022-1031
javax.xml, 995
javax.xml.datatype, 995-1000
javax.xml.namespace, 1000
javax.xml.validation, 277, 281
javax.xml.xpath, 277
validation, 1022-1026
XPath, 1026-1031
XPathEvaluator class, 283
Java Authentication and Authorization Service (JAAS), 204, 970-993
java command, 95
-javaagent argument, 517
running a Java program, 95
(see also Java interpreter)
Java Cryptography Extension (JCE), 301, 639, 922
Java Development Kit (see JDK)
Java Documentation Generator (see javadoc program)
.java file extension, 94
Java interpreter, 2, 332-338
advanced options, 337
annotations, handling of, 191
assertion options, 334
assertions, enabling, 61
break statements, 54
classpaths, specifying for, 94
common options, 333
evaluating expressions, 14, 28
evaluation of operands, 32
garbage collection, 111
instrumentation options, 336
InternalError, 473
iterating through loops, 15
java command-line program, 8
jdb debugger, 353
connection options, 353
just-in-time (JIT) compiler, specifying, 333
loading classes, 338
main( ) method, 10, 95
OutOfMemoryError, 480
performance tuning options, 335
remote monitoring and management, 439
running programs, 94
StackOverflowError, 489
threading system, specifying, 333
versions, 332, 334
java, javax, and sun, package names beginning with, 90
Java Keystore (JKS) type, 329, 365
Java language, 1
case sensitivity, 8
java.lang and subpackages, 439-542
modifiers, summary of, 156
new features, Java 5.0, 159-202
pass by value, 86
syntax, 17-97
arrays, 74-81
case-sensitivity and whitespace, 19
classes and objects, 71-74
comments, 19
differences from C and C++, 95-97
expressions and operators, 28-41
file structure, 93
identifiers, 20
literals, 21
methods, 64-71
packages and namespaces, 89-93
programs, defining and running, 94
primitive data types, 21-27
punctuation characters (tokens), 21
reference types, 81-89
reserved words, 20
statements, 42-64
Unicode character set, 18
Java Native Interface (JNI), 349
Java platform, 1, 2, 203-298
arrays, 224
collections, 225-238
cryptography, 290-292
dates and times, 221-223
(see also dates and times)
extensions to, package names, 89
files and directories, 252
input/output, 254-257
(see also input/output)
I/O and networking withjava.nio, 263-276
management and instrumentation, 296-298
Java platform (continued )
Microsoft proprietary extension of, 310
networking with java.net, 258-263
numbers and math, 217-221
(see also math; numbers)
object persistence, 286
packages (key), summary of, 203
Preferences API, 294
processes, 295
properties, 293
security, 288-290
Standard Edition, 4
text, 205-217
threads and concurrency, 238-252
(see also threads)
types, reflection, and dynamic loading, 283-286
"Write once, run anywhere", 4
XML processing, 276-283
Java programming
conventions, 308-325
naming and capitalization, 308
conventions for JavaBeans, 320-325
example program, 7-16
analysis of, 9-16
compiling and running, 7
network-centric, 5
online tutorial, 15
portability conventions, 310-312
related book, xx
Java Runtime Environment (see JRE)
Java Secure Sockets Extension (JSSE), 259
java.awt package, 204
java.awt.peer package, portability and, 310
JavaBeans, xviii, 320-325
bean basics, 320
bean classes, 321
events, 324
MXBean interfaces (see management package)
properties, 322
bound, 322
constrained, 323
indexed, 322
serialization mechanism for components, 287
javac compiler, 8, 338-342
apt (annotation processing tool), 327
assert statements, handling, 61
classpath, 342
common options, 339
cross-compilation options, 341
javadoc and, 342
@SuppressWarnings annotation, 499
warning options, 340
-xlint option, 195
javadoc program, 20, 342-348
classpath, 348
customizing documentation format, 342
@deprecated tag, 194
HTML documentation, creating, 312-320
options, 342
javah program, 348
java.io package, 203, 254-258, 385-438
(see also input/output)
javakey program, 302
java.lang package, 203, 439-542
annotation types (standard), 194-196
primitive type wrapper classes, 217
subpackages, 439
new in Java 5.0, xviii
java.lang.annotation package (see annotations)
java.lang.instrument package (see instrumentation)
java.lang.management package, 439, 518-526
java.lang.ref package, 204, 526-529
java.lang.reflect package, 204, 283-286, 529-542
annotation support, 198
java.math package, 204, 218, 543-548
java.net package, 204, 258-263, 549-585
(see also networking)
java.nio package, 204, 263-276, 586-600
java.nio.channels package, 263, 265, 586, 600-625
server-side networking, 272
java.nio.channels.spi package, 586, 625-628
java.nio.charset package, 263, 267, 586, 628-637
java.nio.charset.spi package, 586
javap tool, 349-351
java.policy file, 305
java.security package, 204, 288-290, 638-682
java.security.auth package, 204
java.security.cert package, 638, 682-707
java.security.interfaces package, 638, 707-712
java.security.manager system property, 306
java.security.spec package, 638, 712-723
java.text package, 204, 724-749
java.util package, 204, 750, 751-827
additions in Java 5.0, 751
collections classes, 225
converted to generic types, xviii
use of type parameters, 160
Formatter class, xviii
(see also collections; generic types)
java.util.concurrent package, 827-855
(see also concurrency)
java.util.concurrent.atomic package, 252, 855-862
java.util.concurrent.locks package, 246, 862-869
Condition object, 248
java.util.jar package, 204, 564, 869-877
(see also JAR files)
java.util.logging package, 204, 211, 877-892
java.util.prefs package, 204, 294, 892-899
java.util.regex package, 899-909
java.util.zip package, 204, 255, 909-920
javaw interpreter, 332
javaw_g interpreter, 333
javax (package names), 90
javax.crypto package, 204, 290-292, 301, 921-938
javax.crypto.interfaces package, 938-939
javax.crypto.spec package, 939-945
javax.net package, 204, 946-947
JSSE (Java Secure Sockets Extension), 259
javax.net.ssl package, 204, 947-969
JSSE (Java Secure Sockets Extension), 259
javax.security.auth package, 970-976
javax.security.auth.callback package, 970, 976-982
javax.security.auth.kerberos package, 970, 982-985
javax.security.auth.login package, 970, 985-992
javax.security.auth.spi package, 970, 992
javax.security.auth.x500 package, 970, 992
javax.swing package, 204
javax.xml package, 995
new packages, xviii
javax.xml.datatype package, 994, 995-1000
javax.xml.namespace package, 994, 1000
javax.xml.parsers package, 204, 277, 994, 1001-1007
javax.xml.transform package, 277, 280, 994, 1007-1015
javax.xml.transform.dom package, 994, 1015-1016
javax.xml.transform.sax package, 994
javax.xml.transform.stream package, 995, 1020-1022
javax.xml.validation package, 277, 281, 995, 1022-1026
javax.xml.xpath package, 277, 995, 1026-1031
JAXP (Java API for XML Processing)
SAX parser, 277
transforming XML documents, 280
JCE (Java Cryptography Extension), 301, 639, 922
JCEKS keystore, 329
JCEKS (Java Cryptography Extension Key Store), 658
jconsole tool, 352
jdb debugger, 353-357
commands, 354-357
expression syntax, 353
interpreter-to-debugger connection options, 353
options, 353
JDK (Java Development Kit), 4, 326
javac compiler, 8
Sun Microsystems, download site, 7
(see also tools)
jinfo tool, 357
JIT (just-in-time) compilers, 2, 462
performance improvements with, 6
querying with CompilationMXBean, 519
specifying for Java interpreter, 333
using on frequently used methods, 336
JKS (Java Keystore) type, 329, 365, 658
jmap tool, 358
JMX API (see management package)
join( ) (Thread), 239, 249, 250, 502
joinGroup( ) (MulticastSocket), 565
jps tool, 358
JRE (Java Runtime Environment), 4
JDK vs., 7
jsadebugd tool, 359
JSSE (Java Secure Sockets Extension), 259
jstack tool, 360
jstat tool, 360-362
options, 360
jstatd tool, 362
jump table, 46
just-in-time compilers (see JIT compilers)
JVM (Java Virtual Machine), 1, 2
annotations and, 191
array initialization, 77
class loaded, statistics on, 518
debugger connection options (Java 5.0), 353
deleting files on exit, 398
instrument package (see instrumentation)
instrumentation options, 336
jdb debugger, connecting to, 353
JIT compiler (see JIT compilers)
memory manager, monitoring, 520
monitoring and management of, 296-298
monitoring garbage collections, 519
MXBean interfaces, obtaining, 519
performance tuning, 6, 335
permission to monitor and manage, 520
process monitoring tool (jconsole), 352
runtime configuration, 524
security, 300
statistics on (jstat tool), 360-362
thread type, specifying for Classic VM, 333
thread usage, monitoring, 525
UnknownError, 509
UnsupportedEncodingException, 436
versions, 332, 333
VirtualMachineError, 510
JVMTI (Java Virtual Machine Tool Interface), 336
K[ Top ]
keepalive, setting for sockets, 573
Kerberos authentication, 970, 982-985
DelegationPermission, 982
KerberosKey class, 983
KerberosPrincipal class, 983
KerberosTicket class, 984
ServicePermission class, 985
Key interface, 653
key-agreement algorithms, 930
KeyAgreement class, 930
KeyAgreementSpi class, 931
KeyException, 654
KeyFactory class, 654
KeyFactorySpi class, 655
KeyGenerator class, 921, 932
KeyGeneratorSpi class, 933
KeyManagementException, 655
KeyManager interface, 952
KeyManagerFactory class, 952
KeyManagerFactorySpi class, 953
KeyPair class, 656
KeyPairGenerator class, 639, 656
KeyPairGeneratorSpi class, 657
KeyRep class, 657
KeyRep.Type class, 657
keys( )
Hashtable class, 788
Selector class, 620
keys, cryptographic
DES key, 940
KerberosKey, 983
Key interface, 653
management by keytool, 362-366
secret keys (symmetric), generating, 932
SecretKey interface, 936
SSLKeyException, 959
triple-DES key (DESede), 940
(see also cryptography)
keySet( )
Map interface, 233, 801
SortedMap interface, 234, 815
KeySpec interface, 719
KeyStore class, 639, 651, 658, 680
KeyStore.Builder class, 660
KeyStoreBuilderParameters class, 953
KeyStore.CallbackHandler-Protection, 660
KeyStore.Entry interface, 660
UnrecoverableEntryException, 681
KeyStoreException, 662
KeyStore.LoadStoreParameter, 660
KeyStore.PaswordProtection, 661
KeyStore.PrivateKeyEntry, 661
KeyStore.ProtectionParameter, 661
keystores, 329, 362
management with keytool, 362
password, changing, 364
for policy files, 369
type, specifying, 365
(see also keytool program)
KeyStore.SecretKeyEntry, 662
KeyStoreSpi class, 663
KeyStore.TrustedCertificateEntry, 662
keytool program, 290, 362-366
commands, 363
options, 364-366
key/value objects (Map), 231
keywords, 18
abstract, 129
access control, 124
assert, 60, 61
break, 54
case, 47
class, 99
enum, 179
extends, 115
final, 44
if, 13
implements, 99, 136
interface, 135
lines, 339
listing of, 20
lowercase used for, 19
modifier summary, 156
new, 72
null, 74
package, 90
private, 118
public, 118
source, 339
static, 104, 110, 140
super, 116, 119, 122, 145
switch, 47
synchronized, 56
throws, 66
vars, 339
void, 55, 65
(see also modifiers)
L[ Top ]
labeled statements, 43
break statements, using with, 54
continue statement, 54
LanguageCallback class, 980
languages
international, representing with Unicode, 6
pass-by-reference, 86
pass-by-value, 86
last( )
CharacterIterator interface, 730
SortedSet interface, 816
last in, first-out (LIFO) queues, 234
last modified date (URLs), 583
lastIndexOf( )
CharBuffer class, 496
CopyOnWriteArrayList, 835
List interface, 797
String class, 492
lastIndexOfSubList( ) (Collections), 768
last-in-first-out (LIFO) stacks, 816
lastKey( ) (SortedMap), 233, 815
lastModified( ) (File), 397
latch, 249
Latin-1 character set, 18, 267
encoding changed to UTF-8, 269
escaping in char literals, 23
LDAPCertStoreParameters, 697
leaveGroup( ) (MulticastSocket), 565
left shift assignment operator (<<=), 29
left shift operator (<<), 29, 38
left-to-right associativity, 30
length
of arrays, 75, 76
readable sequence of characters, 207
length( )
CharSequence interface, 455
CoderResult class, 634
File class, 397
length( ) (continued )
String class, 491
StringBuffer, 496
less than operator (<), 35
less than or equal operator (<=), 35
Level class, 882
levels of severity, log messages, 212
lexical scope, 44, 150
LexicalHandler interface (SAX), 1067
libraries, reading into the system, 501
lib/security/java.policy file, 305
lifecycle of a thread, 239
LIFO (last-in-first-out) stacks, 816
limit (buffers), 587, 590
line breaks in text, 729
line separators, code portability and, 311
LineNumberInputStream class (deprecated), 410
LineNumberReader class, 410
lines, blank, 13
lines keyword, 339
@link javadoc tag, 319
{@link} javadoc tag, 313, 316, 318
LinkageError, 474
LinkedBlockingQueue class, 251, 844
LinkedHashMap class, 225, 233, 793
LinkedHashSet class, 225, 228, 795
LinkedIterator class, implemented as anonymous class, 151
LinkedList class, 231, 795
implementing Queue, 235
{@linkplain} javadoc tag, 317, 318
links, UnsatisfiedLinkError, 509
"lint" in Java programs, 195, 340
Linux platforms
Java interpreter, 2
JDK, downloading from Sun Microsystems, 7
list( ) (File), 152, 397
List class
Collection interface methods, 226
java.util.List and java.awt.List, 91
methods, generic vs. nongeneric, 166
redefined as generic, 160, 161
storing primitive values, 88
Listener interface, 324
listeners
EventListener, 776
registering
for constrained properties, 323
methods for, 323
TooManyListenersException, 820
for unicast events, 321
listFiles( ) (File), 397, 400
listIterator( ), 230
AbstractSequentialList class, 756
List interface, 797
ListIterator interface, 225, 230, 798
ListResourceBundle class, 799
listRoots( ) (File), 397
lists, 225
AbstractList class, 754
AbstractSequentialList, 756
element or attribute names (DOM), 1045
immutable List objects, 237
LinkedList class, 795
List interface, 225, 229, 796
implementations, general-purpose, 231
random access to, 225
literals, 21, 28
null reference, 74
string, 73
type, 74
literals values, 18
LITTLE_ENDIAN byte order, 592
load( )
KeyStore class, 658
MappedByteBuffer class, 599
Properties class, 806
Runtime class, 484
System class, 501
loadClass( )
ClassLoader class, 458
URLClassLoader class, 582
loadLibrary( )
Runtime class, 484
System class, 501
LoadStoreParameter (KeyStore), 660
local classes, 141, 147-151
defining and using (example), 147
features of, 148
implementation of, 155
local variables, lexical scoping, and closures, 150
restrictions on, 148
scope of, 149
syntax, 149
local variables, 11
annotations, 198
declaration statements, 43
naming and capitalization conventions, 309
scope of, 44, 150
Locale class, 799
Locator interface (SAX), 1059
Locator2 interface (SAX), 1068
Locator2Impl interface (SAX), 1068
LocatorImpl class (SAX), 1072
locks, 245-247, 862-869
Condition objects, 248
deadlock, 247
file, 270
FileChannel methods, 608
FileLock class, 610
file locks, overlapping, 614
interrupted file locks, 611
java.util.concurrent.locks package, 246, 750
listing waiting threads, 248
Lock interface, 865
synchronized methods, 56, 67
verifying for current thread, 63, 502
LockSupport class, 866
log10( ) (Math), 476
logarithmic functions, 217
Logger objects, 212, 883-885
logging, 211
garbage collection events, 337
java.util.logging package, 204, 750, 877-892
LoggingMXBean interface, 885
LoggingPermission class, 886
login( )
AuthProvider class, 645
LoginContext class, 974, 985, 991
LoginModuleControlFlag class, 988
logins, 985-992
AccountException, 987
AccountExpiredException, 987
AccountLockedException, 987
AccountNotFoundException, 987
AppConfigurationEntry, 988
AppConfigurationEntry.LoginModuleControlFlag, 988
Configuration class, 989
CredentialException, 989
CredentialExpiredException, 990
CredentialNotFoundException, 990
FailedLoginException, 990
javax.security.auth.login package, 970
LoginContext class, 985, 991
LoginException, 991
LoginModule interface, 992
LogManager class, 886-888
logout( ) (LoginContext), 991
LogRecord class, 888
long type, 22, 24
64-bit long values, 25
bitwise and shift operator results, 37
conversion to other primitive types, 28
dates and times, 221
Long class, 25, 217, 439, 474
unique identifier for threads, 502
longBitsToDouble( ), 463
LongBuffer class, 598
lookup( ) (ObjectStreamClass), 417
loopback packets, 565
loops, 14
comparison operators, use in, 34
continue statement in, 54
for and while loops, 60
counter, incrementing, 34, 48
do vs. while, 49
empty loop body, 43
exiting with break statements, 54
infinite, 48
iterating through, 15
nested, creating and initializing multidimensional arrays, 81
(see also statements)
lower-bounded wildcards, 178
lowerCaseMode( ), 433
lunar calendars, 222
M[ Top ]
Mac class, 921, 933
MAC (see message authentication code)
Macintosh platforms, 2
MacSpi class, 934
main( ), 10, 95, 517
java interpreter and, 332
running with jdb debugger, 356
MalformedInputException, 636
MalformedParameterizedType-Exception, 537
MalformedURLException, 564
management package, xviii, 203, 296-298, 439, 518-526
ClassLoadingMXBean, 518
CompilationMXBean interface, 519
management package (continued )
jconsole tool, 352
LoggingMXBean, 885
ManagementFactory class, 519
ManagementPermission class, 520
ManagerFactoryParameters interface, 954
Manifest class, 874
manifest files, JAR, 331
creating with jar utility, 330
map( ) (FileChannel), 599, 608
Map interface, 162, 225, 801
ConcurrentMap interface, 834
Entry interface, 802
SortedMap interface, 815
TreeMap class, 820
WeakHashMap class, 826
mapLibraryName( ) (System), 501
MapMode class (FileChannel), 610
MappedByteBuffer class, 599, 608
maps, 225
defined, 231
enumerated values, 225
hashtable-based, 225
immutable Map objects, 237
implementing Cloneable or Serializable, 227
Map interface, 231-234
implementations, 233
support for collection views, 231
memory mapping a file with FileChannel, 269
mark( ), 686
CharArrayReader class, 391
InputStream class, 407
Reader class, 430
StringReader class, 435
mark (buffers), 588, 590
InvalidMarkException, 597
marker annotations, 193
isAnnotationPresent( ), using, 199
marker interfaces, 139
markSupported( )
InputStream class, 407
Reader class, 430
mask generation function, 719
match( )
CertSelector interface, 693
CRLSelector interface, 697
X509CRLSelector class, 706
Matcher class, 212, 900-903
enchancements in Java 5.0, 215
multiple matches with a regular expression, 214
matches( ) (String), 213, 492, 493
MatchResult interface, 903
math, 217-221
java.math package, 543-548
mathematical functions, 217
Math class, 217, 440, 475
new functions in Java 5.0, 218
pseudo-random numbers, 218
static member import, 92
(see also StrictMath class)
MathContext class, 219, 547
max( ) (Collections), 768
MAX_VALUE constant
Float and Double classes, 26
integral type wrapper classes, 25
member classes, 143-147
containing class instance, specifying for, 146
features of, 144
implementation, 155
local classes vs., 147
restrictions on, 145
scope vs. inheritance, 147
syntax for, 145
top-level class that extends, 146
Member interface, 537
members
annotation, 193, 197
class, 9, 99, 100, 529
access control, 124-127
access rules, 126
constructors and initializers, 106
hiding fields and methods, 124
Member interface, 537
nonstatic member classes as, 140
constructors and initializers, 106-111
deprecated (@deprecated javadoc tag), 315
importing static members, 92
instance, 100
modifiers, 156
specifying when added to API (@since doc comment), 315
memory
managing with Runtime, 484
OutOfMemoryError, 480
required by a specified object, 517
usage information for Java process or core file, 358
memory allocation
garbage collection and, 86, 96
for the heap, 336
for javadoc tool, 344
reclaiming with garbage collection, 111
memory leaks, 112
memory mapping a file, 269
MemoryHandler class, 889
MemoryManagerMXBean interface, 520
MemoryMXBean interface, 521
MemoryNotificationInfo class, 521
MemoryPoolMXBean interface, 522
MemoryType class, 522
MemoryUsage class, 523
message authentication code (MAC), 921, 933
MacSpi class, 934
message digests, 256, 288, 301
DigestException, 648
DigestInputStream class, 648
DigestOutputStream class, 649
in digital signatures, 289
MessageDigest class, 639, 663
MessageDigestSpi class, 664
MessageFormat class, 69, 742
MessageFormat.Field class, 743
messages, checking for tampering, 288
meta-annotations, 193, 201
defining, 200
Documented type, 513
Inherited type, 514
Retention type, 514
Target type, 515
metadata, 193
associating with program elements, 191
(see also annotations)
Method class
changes in Java 5.0, 538
getGenericParameterTypes( ), 529
method invocation operator (( )), 29, 41
side effects, 32
methods, 64-71
abstract, 128-130, 156
rules for, 129
chaining, 265
choosing between class and instance, 105
class, 100, 102, 529
hiding, 124
listing with jdb debugger, 355
Collections, 237
covariant return types, 70
data accessor, 127-128
declaring checked exceptions, 68
defining, 10, 64-66
examples, 65
modifiers, 65
name, 66
parameters, 66
return type, 65
throws clause, 66
deprecated (@deprecated javadoc tag), 315
displaying byte code for (javap tool), 350
end of, 12
enforcing preconditions for, 63
enumerated types, 185
event listener interface, 324
generic, 172-176
invoking, 173
IllegalAccessError, 468
IllegalArgumentException, 468
IllegalStateException, 469
inheritance through subclassing, 115
instance, 100, 104-106
inheritance of, 126
interface, InvocationHandler, 286
invoking, 11
in expression statements, 42
InvocationHandler, 536
JavaBean, 321
main( ), 10
Method class, 529, 537
modifiers, 66
naming and capitalization conventions, 309
native, 156
NoSuchMethodError, 478
NoSuchMethodException, 478
Object class, 130-134
overloaded
references to, 319
static member imports and, 93
methods (continued )
overloading, 66, 96, 97
defining multiple constructors for a class, 108
@Override annotation, 481
overriding, 120-123
dynamic method lookup, 121
final and static method lookup, 122
invoking overridden methods, 122
overloading vs., 120
parameters, 10, 66
reference index, 1077-1146
references to, in @see javadoc tag, 319
side effects, 32
static, 157
synchronized, 56, 157, 245
System.out.println( ), 106
in type definitions, 18
unsupported, error, 510
void, 55
(see also variable-length argument lists)
MGF1ParameterSpec class, 719
Micro Edition, Java 2 Platform (J2ME), 4
Microsoft
Java VM implementation, security flaws, 300
proprietary extension of Java platform, 311
Microsoft Windows (see Windows platforms)
milliseconds, 221
MIME types, 554, 558
min( ) (Collections), 768
minus sign (-) (see -, under Symbols)
MIN_VALUE constant
Float and Double classes, 26
integral type wrapper classes, 25
MissingFormatArgumentException, 803
MissingFormatWidthException, 803
MissingResourceException, 803
mkdir( ) (File), 398
mkdirs( ) (File), 398
modification time of a file, 397
modifiers, 9
access control, 124
anonymous classes and, 153
class, 99
field, 101
final, 116
method, 65, 66
Modifier class, 529, 539
not allowed with local variable or class declarations, 148
public, static and void, 10
summary of, 156
visibility, 126
modInverse( ) (BigInteger), 546
modPow( ) (BigInteger), 546
modulo by zero, 25
modulo operator (%), 29, 33
%= (modulo assignment) operator, 29, 39
monitoring a running Java interpreter, xviii
MulticastSocket class, 565
multidimensional arrays, 80
copying, shallow and deep copies, 84
multiline comments, 9, 19
multiple inheritance (C++), 135
multiple interfaces, implementing, 137
multiplication operator (*), 14, 33
multiplication table, representing with multidimensional array, 80
multiply( ) (BigDecimal), 543
multithreaded programming, 238-252
MXBean interfaces (see management package)
N[ Top ]
\n (newlines), escaping, 23
name( ), 464
Charset class, 629
Name class, 871
NameCallback class, 980
NamedNodeMap interface (DOM), 1044
NameList interface (DOM), 1045
names
anonymous classes, 156
classes
fully qualified, 332
simple and fully qualified, 89
file and directory, platform-independent, 397
FilePermission, 402
library, 501
method, 66
package, 90
uniqueness of, 90
signer (digital signatures), 328
namespaces, 89-93, 96
importing types, 90
naming conflicts and shadowing, 91
static members, 92
XML, xviii, 994, 1000
NamespaceContext, 1000
QName class, 1001
URIs for, 995
NamespaceSupport class (SAX), 1072
naming conflicts, 91
between superclass and containing class, 147
naming conventions, 308
characters in names, 309
classes, 308
constants, 102
constructors, 107
fields and constants, 309
generic type variables, 169
images in doc comments, 313
interfaces, 309
local class and its enclosing classes, 149
local variables, 309
methods, 309
packages, 308
parameters, method, 309
reference types, 308
NaN (not-a-number), 26
% (modulo) operator, returning with, 33
Double, testing for, 462
floating point-values, testing for, 35
floating-point calculations, division by zero, 33
represented by float and double types, 26
nanoseconds, 221
nanoTime( ) (System), 221, 500
narrowing conversions, 27
covariant returns, 159
reference types, 86
native code, byte code vs., 6
native methods, 67, 156
conventions/rules for, 310
Java, implemented in C, 348
javah tool for implementing in C, 348
printing message when called, 337
stack traces for errors or exceptions, 490
native OS threads, 333, 335
native2ascii program, 366
nativeOrder( ) (ByteOrder), 592
nCopies( ) (Collections), 237
negation, performing with - (unary minus) operator, 33
negative infinity, 26
Double, testing for, 462
negative integers, representing, 37
negative zero, 26
NegativeArraySizeException, 477
nested types, 140-156
anonymous classes, 141, 151-154
defining and instantiating, 153
features of, 153
indentation and formatting, 154
restrictions on, 153
when to use, 153
Class methods, Java 5.0, 456
how they work, 154-156
local classes, 141, 147-151
features of, 148
local variables, lexical scoping, and closures, 150
restrictions on, 148
scope of, 149
syntax, 149
nonstatic member classes, 140, 143-147
features of, 144
restrictions on, 145
scope vs. inheritance, 147
syntax for, 145
static member types, 140, 141-143
NetPermission class, 566
network-centric programming, 5
networking
closing connections for unused objects, 113
datagrams, 262
getByAddress( ), Inet6Address, 561
host reachability, 263
java.net package, 258-263, 549-585
Proxy class, 568
java.nio package (see New I/O API)
javax.net package, 946-947
networking (continued )
javax.net.ssl package, 947-969
Kerberos authentication, 982-985
packages for, 204
secure sockets (SSL), 259
servers, 261
sockets, 258
(see also sockets)
NetworkInterface class, 566
New I/O API, 204, 263-276, 586-637
buffer operations, basic, 264
channel operations, basic, 265
client-side networking, 271
encoding/decoding text with charsets, 267
files, working with, 268-270
java.nio.channels.spi package, 625-628
java.nio.charset package, 628-637
java.nio.charset.spi package, 637
nonblocking I/O, 273-276
SSL communication, 955
server-side networking, 272
new operator, 29, 41, 107
anonymous class formatting, 154
creating arrays, 76
creating objects, 72
defining and implementing anonymous class, 152
member class, explicitly referring to containing instance, 146
multidimensional arrays, initializing, 80
NEW thread, 239, 504
newDecoder( ) (CharsetDecoder), 630
newEncoder( ) (CharsetEncoder), 630
newInstance( )
Array class, 532
Class class, 72, 455
Constructor class, 72, 533
DatatypeFactory class, 996
SchemaFactory class, 1022
URLClassLoader class, 582
newlines (\n), escaping, 23
newPermissionCollection( ), 667
newPlatformMXBeanProxy( ) (ManagementFactory), 519
newProxyInstance( ) (Proxy), 540
newReader( ) (Channels), 628
newSAXParser( ), 1006
newSchema( ) (SchemaFactory), 1023
newTemplates( ) (TransformerFactory), 1013
newTransformer( ) (TransformerFactory), 1013
newWriter( ) (Channels), 628
next( ), 756
CharacterIterator interface, 730
Iterator class, 753
Iterator interface, 52
ListIterator interface, 798
nextBytes( ) (SecureRandom), 675
nextDouble( ), 809
nextElement( ) (Enumeration), 774
nextFloat( ), 809
nextIndex( ) (ListIterator), 798
nextInt( ), 809
nextLong( ), 809
nextToken( ) (StreamTokenizer), 433
NoClassDefFoundError, 477
NoConnectionPendingException, 613
Node interface, 279
Node objects (DOM), 1015, 1016, 1045-1048
NodeChangeEvent class, 895
NodeChangeListener interface, 895
NodeList interface (DOM), 1048
nonblocking I/O, 204, 273-276
client-side networking, 275
socket connection (example), 275
SocketChannel, 622
SSL communication using, 955
nonheap memory, usage information, 521
nonnative (green) threads, 333, 335
NonReadableChannelException, 613
nonstatic member classes, 143-147
features of, 144
restrictions on, 145
scope vs. inheritance, 147
syntax for, 145
nonstatic members, 99
NonWritableChannelException, 613
normalize( ) (URI), 579
NoRouteToHostException, 567
NoSuchAlgorithmException, 665
NoSuchElementException, 798, 804
NoSuchFieldError, 477
NoSuchFieldException, 478
NoSuchMethodError, 478
NoSuchMethodException, 478
NoSuchPaddingException, 935
NoSuchProviderException, 665
not equals operator (!=), 29, 35
NOT operator
~ (bitwise NOT), 37
! (boolean NOT), 29, 36
NotActiveException, 411
not-a-number (see NaN)
Notation interface (DOM), 1048
Notepad, 8
notify( ) (Object), 248, 469, 479, 502
notifyAll( ) (Object), 248, 479
notifying event listeners of events, 321
bound property changes, 323
constrained property changes, 324
NotSerializableException, 411
NotYetBoundException, 613
NotYetConnectedException, 614
null values, 74
case labels and, 182
collections, 227
default, reference fields, 109
LinkedList, 235
NullCipher class, 935
NullPointerException, 68, 478
numberOfTrailingZeros( ) (Integer), 472
numbers, 217-221
BigInteger and BigDecimal classes, 218
comparing (Comparator class), 770
converting from and to strings, 219
DateFormat class, 734
DecimalFormat class, 737
Enumeration class, 774
formatting, 220, 741
mathematical functions, 217
Number class, 217, 479
number type (operands), 31
NumberFormat class, 221, 724, 744-745
NumberFormatException, 479
parsing by StreamTokenizer, 433
random, 218
SimpleDateFormat class, 747
O[ Top ]
OAEP padding (PKCS#1 standard), 719, 943
OAEPParameterSpec class, 942
Object class, 479
class hierarchy root, 87, 116
important methods, 130-134
clone( ), 84, 134
compareTo( ), 133
equals( ), 132
hashCode), 133
toString( ), 132
notify( ), 248
wait( ), 239, 248
object creation operator (see new operator)
object identifier (OID), 707
object literals, 73
object member access operator (.), 29, 41
object persistence, 286
JavaBeans, 287
serialization, 286
object serialization (see serialization)
Object... variable length argument list, 69
ObjectInput interface, 411
ObjectInputStream class, 386, 432
enableResolveObject( ), 432
readStreamHeader( ), 433
ObjectInputValidation class, 414, 432
object-oriented classes
nested types
local classes, 147-151
object-oriented programming, 98-158
abstract classes and methods, 128-130
anonymous classes, 151-154
class definitions, 99
classes, 5
creating and initializing objects, 106-111
defining a constructor, 107
defining multiple constructors, 108
field defaults and initializers, 109-111
invoking one constructor from another, 108
data hiding and encapsulation, 123-128
access control, 124-127
data accessor methods, 127-128
definitions of terms, 98
object-oriented programming(continued )
destroying and finalizing objects, 111-114
finalizers, 113
garbage collection, 111
memory leaks, 112
fields and methods, 100-106
class fields, 102
class methods, 102
field declarations, 101
instance fields, 103
instance methods, 104-106
System.out.println( ), 106
interfaces, 135-140
abstract classes vs., 138
constants and, 139
implementing, 136-138
marker, 139
Java vs. C/C++, 1
modifiers, summary of, 156
nested types, 140-156
anonymous classes, 151-154
how they work, 154-156
nonstatic member classes, 143-147
Object methods, 130-134
subclasses and inheritance, 114-123
constructor chaining and the default constructor, 117
extending a class, 114-116
hiding superclass fields, 119
overriding superclass methods, 120-123
subclass constructors, 116
superclasses, Object and class hierarchy, 116
ObjectOutput interface, 415
ObjectOutputStream class, 386, 415, 432
enableReplaceObject( ), 432
ObjectOutputStream.PutField class, 416
objects, 71-74
AccessibleObject class, 530
arrays as, 225
as operand type, 31
classes vs., 71
collections of, 204
converting to and from arrays, 237
comparing, 85
converting arrays to, 87
converting to strings, 34
copying, 83-85
creating and initializing, 72, 106-111
defining a constructor, 107
expression statements, using, 42
instance initializers, 111
invoking one constructor from another, 108
multiple constructors, 108
new operator, using, 41
defined, 98
exception, 58
information about, obtaining with instanceof, 139
instanceof operator, using with, 40
InvalidObjectException, 409, 414
locking, 56, 245-247
manipulating by reference, 158
NullPointerException, 478
Object class, 479
serializing/deserializing (see serialization)
SignedObject class, 290
state of, in instance fields, 103
strings as, 73
type defined by class or interface, 98
using, 73
waiting threads, list of, 248
(see also object-oriented programming)
ObjectStreamClass class, 417
ObjectStreamConstants interface, 418
ObjectStreamException, 419
ObjectStreamField class, 419
Observable class, 804
Observer interface, 805
octal numbers, 24
Integer type conversions, 472
Long type conversions, 474
Short type conversions, 488
of( )
EnumSet class, 184
UnicodeBlock class, 452
offer( ) (Queue), 234
offsetByCodePoints( )
Character class, 448
String class, 493
OID (object identifier), 707
oldjava interpreter, 333
oldjavaw interpreter, 333
on( )
DigestInputStream class, 648
DigestOutputStream class, 649
on-demand type imports, 91
naming conflicts and shadowing, 92
onMalformedInput( ), 635
onUnmappableCharacter( ), 635
OO (see object-oriented programming)
open( )
connected SocketChannel, creating, 271
DatagramChannel class, 605
Pipe class, 614
unconnected SocketChannel, creating, 271
openConnection( ) (URL), 581, 948, 951
openStream( ) (URL), 581
operands
evaluation by Java interpreter, 32
list of, 28
number and type, 31
operating systems, 2
OperatingSystemMXBean interface, 523
operators, 14, 18, 28-41
arithmetic, 32
assignment, 39
associativity, 30
bitwise and shift, 37
boolean, 35
characters used as, 21
comparison, 34
relational operators, 35
conditional, 39
expressions, order of evaluation, 32
increment and decrement, 34
instanceof, 40
listed, 28-29
new, 72
operand number and type, 31
overloading, 158
precedence of, 30
return types, 31
side effects of, 32
combination assignment operators, 39
special (language constructs), 40
string concatenation, 33
ternary, 31
OptionalDataException, 420
OR operator
| (bitwise OR), 29, 37
|= (bitwise OR assignment) operator, 29
| (boolean OR), 29, 37
|| (conditional OR), 29, 36
order( ) (ByteBuffer), 590
order of evaluation, 32
ordinal( ), 180, 464
enumerated types, 183
ordinaryChar( ) (StreamTokenizer), 433
ordinaryChars( ) (StreamTokenizer), 433
org.ietf.jgss package, 982
org.w3c.dom package, 276, 1032-1050
org.xml.sax package, 276, 1051-1064
org.xml.sax.ext package, 1064-1069
org.xml.sax.helpers package, 1069-1076
out of band data, receiving, 573
OutOfMemoryError, 68, 480
output (see input/output)
OutputKeys class, 1008
OutputStream class, 385, 420
write( ), 386
OutputStreamWriter class, 421
OverlappingFileLockException, 614
overlaps( ) (FileLock), 610
overloaded methods, references to, 319
overloading
methods, 66, 97
defining multiple constructors for class, 108
overriding vs., 120
operators, 158
overridden methods
chaining, 123
superclass of a containing class, 145
@Override annotation, 131, 194, 440, 481
overriding methods, 71, 120-123
abstract, 129
dynamic method lookup, 121
field hiding vs., 121
final and static method lookup, 122
inherited methods, 99
invoking overridden methods, 122
Object class methods, 131
overview page, javadoc documentation, 320, 344
overview doc comment, using, 346
P[ Top ]
Pack200 class, 875
pack200 tool, 366
advanced options, 368
basic options, 367
Pack200.Packer interface, 875
Pack200.Unpacker interface, 876
package access, 125
class member accessibility, 127
package annotations, 197
Package class, 481
package declarations, 18
package directive, 90
packages, 2, 17, 89-93
access to, 124
assertions enabling or disabling, 459
associated with classes, 459
declaring, 90
defined, 89
doc comments for, 319
enabling assertions in all classes and its subpackages, 61
globally unique names, 90
importing types, 90
naming conflicts and shadowing, 91
static members, 92
key, listing of, 203
naming and capitalization conventions, 308
not documented in this book, 204
omitting names in javadoc documentation, 346
references to, in @see javadoc tag, 318
unnamed, 90
visibility, 156
packets of data, 262
loopback, 565
padding schemes (cryptography), 935
PalmOS, 2
@param javadoc tag, 314
parameterized types, 52, 160
arrays, 166
bounded wildcards in, 168
conversion to nonparameterized, 165
exceptions and, 175
generic types vs., 160
hierarchy, 164
malformed, exception, 537
Map, 231
ParameterizedType interface, 539
parameters, 10
arguments, assigning to, 12
certification path, 691
listing for methods, 66
naming and capitalization conventions, 309
this (keyword), for instance methods, 104
type parameters, 163
annotation types and, 200
specifying for generic methods, 173
wildcards, 166-169
as variables, 11
<xsl:param> tags, 1011
parameters, method
annotations, 198
parentheses (see ( ), under Symbols)
parse( ), 746
parseByte( ), 447
parseDouble( ), 463
ParseException, 746
parseInt( ) (Integer), 11, 472
parseLong( ) (Long), 474
parseNumbers( ) (StreamTokenizer), 433
parseObject( ), 741, 746
ParsePosition class, 746
Parser interface (SAX), 1059
ParserAdapter class (SAX), 1073
ParserFactory class (SAX), 1074
parsers, 204, 1001-1007
DocumentBuilder class, 1002
DocumentBuilderFactory class, 1003
DOM (Document Object Model), 276, 278
FactoryConfigurationError, 1004
javax.xml.parsers package, 994
ParserConfigurationError, 1004
SAX (Simple API for XML), 276
SAXParser class, 1005
SAXParserFactory, 1006
parseShort( ), 488
pass by reference, 86
pass by value, 86
PasswordAuthentication class, 567
password-based encryption (PBE), 939, 943
PasswordCallback class, 980
passwords
access control for /etc/passwd, 302, 303
authenticating, Authenticator class, 551
expired, 990
incorrect, 990
-keypass password option, jarsigner, 329
keystore, changing, 364
PasswordProtection (KeyStore), 661
(see also logins)
path separators, 326
pathnames, JAR archive, 564
paths (CertPath), 688
Pattern class, 213, 214, 904-908
multiple matches with a regular expression, 214
regular expression syntax, 905-908
pattern matching with regular expressions (see regular expressions)
PatternSyntaxException, 214, 908
PBE (password-based encryption), 943
PBEKey interface, 939
PBEKeySpec class, 943
PBEParameterSpec class, 943
PBEWithMD5AndDES algorithm, 923
peek( )
Queue interface, 234, 235
Stack class, 816
percentages, 744
performance, 6
dynamic vs. static method lookup, 122
Java VM, 2
performance tuning options, Java interpreter, 335
Perl 5 programming language, 213
Perl regular expressions, 212
matches, Java vs., 213
permissions, 303
AllPermission class, 645
AuthPermission class, 971
BasicPermission class, 646
checking with SecurityManager, 487
defining in policy file, 369
DelegationPermission, 982
FilePermission class, 402
guidelines for, web site information, 305
how they work, 303
jstatd daemon, 362
LoggingPermission, 886
ManagementPermission class, 520
NetPermission class, 566
Permission class, 304, 666
subclasses for access control, 303
subclasses, summary of, 306
PermissionCollection class, 305, 667
Permissions class, 639, 667
PrivateCredentialPermission, 973
PropertyPermission class, 807
ReflectPermission class, 540
restricted, 5
RuntimePermission class, 486
SecurityPermission class, 677
SerializablePermission class, 432
ServicePermission, 985
SocketPermission class, 577
SSLPermission class, 960
UnresolvedPermission class, 681
URLClassLoader class, 582
persistence, object, 286
JavaBeans, 287
serialization, 286
serialPersistentFields, 316
PhantomReference class, 526
ping utility, 263
Pipe class, 614, 620
PipedInputStream class, 257, 385, 422
PipedOutputStream class, 257, 385, 422
PipedReader class, 257, 423
PipedWriter class, 257, 424
Pipe.SinkChannel class, 615
Pipe.SourceChannel class, 615
PKCS #1 standard, OAEP padding, 942, 943
PKCS#5 (password-based encryption algorithm), 943
PKCS8EncodedKeySpec interface, 719
PKIXBuilderParameters class, 698
PKIXCertPathBuilderResult class, 698
PKIXCertPathChecker class, 699
PKIXCertPathValidatorResult class, 699
PKIXParameters class, 700
platforms
defined, 2
directory separator characters, 311
line separators, differences in, 311
pleaseStop( ) (example method), 241
plus sign (+) (see +, under Symbols)
Point class (example), defining, 72
pointers (C language), 82
Java references vs., 96
method, 97
policies (see security policies)
Policy class, 303, 639, 668, 972
modifying permissions to untrusted code, 305
PolicyNode class, 701
PolicyQualifierInfo class, 701
policytool program, 303, 305, 369
defining permissions, 369
poll( )
Queue interface, 234, 235
ReferenceQueue class, 527
pop( ), 816
portability
conventions and rules, 310-312
Java interpreter, 2
ports, access restrictions for applets, 301
PortUnreachableException, 567
position( ), 270
FileChannel class, 607
FileLock class, 610
position (buffers), 587, 590
positive zero, 26
post-decrement operator, 29, 34
post-increment expression statements, 42
post-increment operator, 29, 34
<PRE> tag in doc comments, 313
precedence, operator, 28, 30
! (boolean NOT) operator, 36
boolean vs. comparison operators, 36
conditional (?:) operator, 40
order of evaluation and, 32
overriding with parentheses, 30
precision (format specifier), 784
illegal, 791
precision in BigDecimal arithmetic, 547
pre-decrement expression statements, 42
pre-decrement operator, 29, 34
predefined classes, 2
preferences, 892-899
AbstractPreferences, 893
BackingStoreException, 894
InvalidPreferencesFormatException, 894
java.util.prefs package, 204, 750
NodeChangeEvent, 895
NodeChangeListener, 895
PreferenceChangeEvent class, 896
PreferenceChangeListener, 295, 896
Preferences class, 294, 896-899
PreferencesFactory interface, 899
user, Properties class and, 293
pre-increment operator, 29, 34
premain( ), 517
preprocessor (C language), 95
prev( ) (CharacterIterator), 730
previous( ) (ListIterator), 756, 798
previousIndex( ) (ListIterator), 798
primary expressions, 28
prime numbers
large, randomly generated, 219
RSA private key, 721
primitive data types, 18, 21-27
array elements, returning as, 531
arrays of, conversions, 88
boolean, 22, 446
buffers for, 587
byte, 24
byte buffers viewed as other types, 590
char, 22
Character class, 448
conversions
boxing and unboxing, 88
listing of type conversions, 27
differences between Java and C, 96
double, 462
encountered when object data is expected, 420
equality, testing for, 35
fields, 534
float, 467
floating-point types, 25
int, 24
Integer class, 472
integer types, 24
long, 22, 25
Long class, 474
operand, 31
reading in binary format with DataInput, 393
reading in binary format with DataInputStream, 386, 394
reference types vs., 82
short, 24
Short class, 488
textual representation of, 424
wrapper classes, 217, 439
writing in binary format with DataOutput, 395
writing in binary format with DataOutputStream, 386, 395
(see also listings under individual type names)
Principal interface, 369, 668
principals
KerberosPrincipal, 983
X.500, 970, 992
print( )
PrintStream class, 424
PrintWriter class, 426
printf( ), 69, 386, 426
Formatter class, xviii, 211
formatting numbers, 220
formatting text, 210
MissingFormatArgumentException, 803
printList( ), 166
println( ), 12
PrintStream class, 424
PrintStream or PrintWriter, 311
PrintWriter class, 426
PrintStream class, 424
format( ), 211
implementing Appendable interface, 386
Java 5.0 enhancements, 386
printf( ), 210
println( ), 311
PrintWriter class, 386, 426
format( ), 211
Java 5.0 enhancements, 386
printf( ), 210
println( ), 311
priority levels for threads, 240, 502
maximum priority in a ThreadGroup, 506
priority queue, 234
PriorityBlockingQueue class, 251, 845
PriorityQueue class, 235, 251, 805
private keys, 289
EncryptedPrivateKeyInfo class, 927
-keypass password option, jarsigner, 329
private modifier, 124, 156
anonymous classes and, 153
class member visibility, 127
class members, 99, 125
constructors, 118
fields, 101
local classes and, 148
member class, applying to, 144
methods, 67
abstract modifier and, 129
inheritance and, 122
static member types and, 142
PrivateCredentialPermission class, 973
private-key encryption, 639, 938
Diffie-Hellman private key, 941
DSA private key, 709
RSA private key, 711
PrivateKey interface, 669
DSA, casting to, 709
RSAPrivateCrtKey, casting to, 711
PrivateKeyEntry class (KeyStore), 661
PrivilegedAction interface, 669
PrivilegedActionException, 670
PrivilegedExceptionAction, 670
probablePrime( ) (BigInteger), 219
procedures (see methods)
Process class, 295, 440, 482
ProcessBuilder class, 295, 440, 482
processes, 295
graphical interface to monitoring tools (jconsole), 352
information about (jinfo), 357
jdb connections to, 354
listing running Java processes, 358
local, providing information about (jstatd tool), 362
spawning and executing on native system, 310
stack traces (jstack tool), 360
ProcessingInstruction interface (DOM), 1049
profiling
Java interpreter options, 336
printing output to standard output, 337
programmers
application, security for, 304
benefits of using Java, 6
system, security for, 304
programming languages
C and C++ (see C and C++)
Java (see Java language)
lexically scoped, 150
Perl, regular expressions in, 212
strongly typed, 11
programs, Java, 17
classes as fundamental unit, 9
compiling, 8
complete, portability of, 311
defining and running, 94
dynamic, extensible, 5
lexical structure, 18-21
case sensitivity and whitespace, 19
comments, 19
identifiers, 20
literals, 21
punctuation, 21
Unicode, 18
main( ) method, 10
overview, 18
running, 8
propagating exceptions, 57
properties, 128
JavaBean, 321
bound properties, 322
constrained properties, 323
conventions for, 322
indexed properties, 322
specialized subtypes, 321
Properties class, 233, 293, 806
invalid properties exception, 792
PropertyPermission class, 807
PropertyResourceBundle class, 808
system, listed, 500
XML transformation output, 1010
PropertyChangeEvent class, 321
PropertyChangeListener interface, 321
adding/removing listeners, 323
PropertyChangeSupport class, 323
propertyNames( ), 806
PropertyVetoException class, 321, 324
protected modifier, 124, 157
anonymous classes and, 153
class members, 99, 125, 126
fields, 101
finalizer methods, 113
local classes and, 148
member class, applying to, 144
methods, 67
Object.clone( ), 134
ProtectionDomain class, 639, 670
ProtectionParameter (KeyStore), 661
protocol, serialization, 418
ProtocolException, 568
provider( ) (SelectorProvider), 627
Provider class, 671
ProviderException class, 673
Provider.Service class, 673
Proxy class, 286, 529, 540, 568
ProxySelector class, 569
Proxy.Type class, 568
pseudo-random numbers, 218, 639, 809
Cipher class, 923
generating with Math class, 475
SecureRandom class, 674
SecureRandomSpi, 675
PSource class, 943
PSource.PSpecified class, 944
PSSParameterSpec class, 720
public modifier, 124, 157
anonymous classes and, 153
in class definitions, 99
class fields, 102
class members, 99, 125, 126
classes, 9
in Java files, 94
constructors, 118
fields, 101
finalizer methods, 113
local classes and, 148
member class, applying to, 144
methods, 67
interface, 135
JavaBeans, 321
public-key encryption, 939
Diffie-Hellman public key, 942
DSA public key, 709
RSA public key, 712
(see also cryptography)
PublicKey interface, 673
RSA, setting to, 707
RSAPublicKey, casting to, 712
punctuation characters
escaping, 23
identifier names and, 21
representing operators, 18
as tokens, 21
push( ), 816
PushbackInputStream class, 427
PushbackReader class, 428
put( ), 251
AbstractMap class, 755
Buffer class, 587
ByteBuffer class, 589
HashMap class, 786
Hashtable class, 788
Map interface, 231, 801
Properties class, 806
Queue interface, 234, 235
TreeMap class, 820
putAll( ) (Map), 232, 801
PutField class, 416
putFields( ), 415
putIfAbsent( ) (ConcurrentMap), 233
putValue( ) (SSLSocket), 962
Q[ Top ]
QName class, 1001
QuadraticSequence class, 238
qualified names (QName class), 1001
queues
BlockingQueue interface, 830
example of use, 242
implementations, 251
ConcurrentLinkedQueue, 833
DelayQueue class, 838
FIFO and LIFO, 234
insertion and removal operations, 234
LinkedBlockingQueue, 844
PriorityBlockingQueue, 845
PriorityQueue class, 805
Queue and BlockingQueue interfaces, 234-235
BlockingQueue, 234
Queue interface, 225, 751, 808
Collection methods, 226
ReferenceQueue, 527
SynchronousQueue, 850
quick reference material, generation of, xxii
quoteChar( ) (StreamTokenizer), 433
R[ Top ]
\r (carriage return), 23
radians, 217
radiansToDegrees( ) (Circle), 103
random access to file contents, 270
Random class, 218, 809
random numbers
SecureRandom class, 674
SecureRandomSpi, 675
(see also pseudo-random numbers)
RandomAccess interface, 139, 225, 810
RandomAccessFile class, 253, 268, 385, 429
raw types, 163
using wildcard (?) instead of, for generics, 167
RC2ParameterSpec class, 944
RC5ParameterSpec class, 945
read( ), 873
DataInputStream class, 394
DigestInputStream class, 648
FileChannel class, 268, 607
FileInputStream class, 400
FilterReader class, 405
InputStream class, 385, 407
Manifest class, 874
PushbackInputStream class, 427
ReadableByteChannel, 606, 616
Reader class, 430
SelectableChannel interface, 617
Socket class, 572
SocketChannel class, 622
read, write, delete, and execute permissions, 402
Readable interface, 215, 386, 440, 483
ReadableByteChannel interface, 266, 268, 616
Reader class, 254, 386, 430
charset encoder/decoder, 630
readExternal( ) (Externalizable), 397
readFields( ) (ObjectInputStream), 414
readFully( ) (DataInputStream), 394
reading
byte and character streams, 254
file contents, 252
(see also input/output)
readLine( )
BufferedReader class, 386
DataInputStream class (deprecated method), 389, 394
LineNumberReader class, 410
ReadLock class, 868
readObject( ), 412, 415
ObjectInputStream class, 413, 414, 420
ObjectOutputStream class, 432
read-only buffers, 588, 590
read-only collections, 236
read-only files, 397
ReadOnlyBufferException, 599
readUnsignedByte( ), 394
readUnsignedShort( ), 394
ReadWriteLock interface, 866
ready( ) (Reader), 430
readyOps( ) (SelectionKey), 619
receive( )
DatagramChannel class, 605
DatagramSocket class, 556, 567
rectangular arrays, 81
red-black tree, 228, 233
redefineClasses( ) (Instrumentation), 517
redirectErrorStream( ) (ProcessBuilder), 483
redirection of system in, out, and err streams, 500
ReentrantLock interface, 866
ReentrantReadWriteLock class, 867
ReentrantReadWriteLock.ReadLock class, 868
ReentrantReadWriteLock.WriteLock class, 869
reference types, 81-89
boxing and unboxing conversions, 88
C language pointers vs., 96
comparing objects, 85
conversions, 86-89
copying objects, 83-85
defined by Java, 99
definitions, in Java programs, 18
enumerated (see enumerated types)
equality, testing for, 35
in operands, 31
instance of operator, using with, 40
interface (see interfaces)
memory allocation and garbage collection, 86
naming and capitalization conventions, 308
pass by value, 86
primitive types vs., 82
references, 526-529
cross references in doc comments, 315
cross-references in doc comments, 318
java.lang.ref package, 439
null, 74
PhantomReference class, 526
Reference class, 527
ReferenceQueue class, 527
SoftReference class, 528
to objects
object member access (.) operator, 41
restoring with this pointer, 114
unused, causing memory leaks, 112
weak references, 204
WeakReference class, 528
referent, 526
reflection, 283-286
Reflection API, 529-542
annotation support, 198
applets, security restrictions on, 302
changes in Java 5.0, 529
Class class, 529
Java 5.0 methods, 456
dynamic proxies, 286
@Inherited annotation type, 202
java.lang.reflect package, 204, 439
(see also Class class)
ReflectPermission class, 540
refresh( )
Policy class, 668
Refreshable interface, 974
Refreshable interface, 974
RefreshFailedException, 974
regionMatches( ) (String), 492
register( ) (SelectableChannel), 617, 618
registering event listeners, 321, 325
for constrained properties, 323
methods, conventions for, 323
unicast event, 325
registerValidation( ), 412, 414
regular expressions, 212-215, 899-909
java.util.regex package, 204, 751
Matcher class, 900-903
matches, Java vs. Perl, 213
MatchResult interface, 903
multiple matches, 214
Pattern class, 904-908
regular expression syntax, 905-908
PatternSyntaxException, 908
search-and-replace operations, 213
strings, using with, 493
RejectedExecutionException, 846
RejectedExecutionHandler interface, 846
relational operators, 34
relativize( ) (URI), 579
RELAX NG (XML schema), 281
release( ) (Semaphore), 249
release of Java, specified for source files, 346
remove( )
AbstractList class, 754
AbstractMap class, 755
Collection interface, 227, 766
HashSet class, 787
Hashtable class, 788
Iterator interface, 753, 793
LinkedList class, 795
List interface, 229, 797
ListIterator interface, 798
Map interface, 231, 232, 801
Queue interface, 235
ReferenceQueue class, 527
Set interface, 228
TreeMap class, 820
TreeSet class, 821
remove methods, deregistering event listeners, 321
removeAll( )
Collection class, 766
List interface, 229
Map interface, 232
removeElementAt( ) (Vector), 824
removePropertyChangeListener( ), 323
removeProvider( ) (Security), 676
removeValue( ) (SSLSocket), 962
removeVetoableChangeListener( ), 323
renameTo( ) (File), 398
repetitive tasks, threads for, 241
replace( )
String class, 492
StringBuffer class, 495
replaceAll( ) (String), 213, 493
replaceFirst( ) (String), 213, 493
requestPasswordAuthentication( ) (Authenticator), 551, 566
reserved words, 20
(see also keywords), 116
reset( ), 686
ByteArrayOutputStream class, 391
CharArrayReader class, 391
CharArrayWriter class, 392
InputStream class, 407
MessageDigest class, 664
Reader class, 430
SAXParser class, 1005
StringReader class, 435
Transformer class, 1011
resetSyntax( ) (StreamTokenizer), 433
resolve( ) (URI), 579
ResourceBundle class, 810
resources associated with a class, 458
resources for further information
examples in this book, xxi
quick reference material, generating, xxii
related books, xx
ResponseCache class, 569
Result interface, 280, 1009
results, computing, 12
resume( ) (Thread), 502
retainAll( )
Collection interface, 227, 766
List interface, 229
Map interface, 232
@Retention annotation, 200, 202, 514
retention (of an annotation), 193
RetentionPolicy class, 202
@return javadoc tag, 315
return statements, 13, 15, 55
switch statements, stopping, 47
return types, 31
covariant, 70
method overriding and, 120
return values, 10
comparison and relational operators, 34
methods, data types for, 65
reverse( ) (Collections), 768
reverseOrder( ) (Collections), 767
rewind( ) (Buffer), 588
right shift operator (>>), signed, 29, 38
>>= (signed right shift assignment) operator, 29
right shift operator (>>>), unsigned, 29
>>>= (unsigned right shift assignment) operator, 29
right-to-left associativity, 30
root directories, listing, 397
root directory of generated documentation, 317
rotate( ) (Collections), 768
rotateLeft( ) (Integer), 472
rotateRight( ) (Integer), 472
rounding numbers
BigDecimal class and, 543
floating-point values when converting to integers, 27
functions for, 217
RoundingMode class, 219, 548
RSA and DSA public and private keys, 707
RSA PSS encoding (PKCS#1 standard), 720
RSAKey interface, 710
RSAKeyGenParameterSpec, 720
RSAMultiPrimePrivateCrtKeySpec, 721
RSAOtherPrimeInfo class, 721
RSAPrivateCrtKey interface, 711
RSAPrivateCrtKeySpec interface, 722
RSAPrivateKey interface, 712
RSAPrivateKeySpec class, 722
RSA-PSS signature (PKCS#1 standard), 719
RSAPublicKey interface, 707, 712
RSAPublicKeySpec interface, 722
RuleBasedCollator class, 747
run( ), 238, 440
call( ) vs., 243
PrivilegedAction interface, 669
PrivilegedExceptionAction, 670
Runnable interface, 484
Thread class, 238, 502
TimerTask class, 818
runFinalization( ) (System), 500
Runnable interface, 238, 243, 250, 440, 484
getDelegatedTask( ), 956
scheduling Runnable objects, 244
RUNNABLE thread, 239, 504
running Java programs, 8, 94
Runtime class, 440, 484
addShutdownHook( ), 114, 297
exec( ), portability conventions and rules, 310
runtime environment, Java, 1, 4
RuntimeException, 68, 485
RuntimeMXBean interface, 524
RuntimePermission class, 486
S[ Top ]
sameFile( ) (URL), 581
sandbox, 301
SAX (Simple API for XML), 276, 1051-1076
javax.xml.transform package, 994
javax.xml.transform.sax package, 1017-1020
org.xml.sax package, 1051-1064
org.xml.sax.ext package, 1064-1069
org.xml.sax.helpers package, 1069-1076
parsing XML, 277
representing XML documents as method call sequences, 280
validation, source documents, 1024
ValidatorHandler and, 1025
SAXException, 1060
SAXNotRecognizedException, 1060
SAXNotSupportedException, 1061
SAXParseException, 1061
SAXParser class, 277, 1005
SAXParserFactory class, 1006
SAXResult class, 1017
SAXSource class, 282, 1018
SAXTransformerFactory class, 1018
Scanner class, 215, 440, 751, 811-813
InputMismatchException, 792
ScatteringByteChannel, 266, 616
schedule( ) (Timer), 818
scheduleAtFixedRate( ) (Timer), 818
scheduledExecutionTime( ) (TimerTask), 819
ScheduledExecutorService, 244, 847
ScheduledFuture interface, 244, 848
ScheduledThreadPoolExecutor, 848
scheduling tasks, 751
schemas, XML, 281
Schema class, 1022
SchemaFactory class, 1022
SchemaFactoryLoader class, 1023
specifying for parser, 1006
scientific notation, 25
scope, 12, 44
inheritance vs., for member classes, 147
local classes, 149
local variables, local classes and, 150
sealed packages, 481
SealedObject class, 292, 935
search-and-replace operations, using regular expressions, 213
searching
arrays, 79, 224
collections elements, 237
SecretKey interface, 290, 936
SecretKeyEntry (KeyStore), 662
SecretKeyFactory class, 936
SecretKeyFactorySpi class, 937
SecretKeySpec class, 945
Secure Hash Algorithm (SHA), 370
secure hash (see message digests)
SecureCacheResponse class, 570
SecureClassLoader class, 674
SecureRandom class, 218, 639, 674
SecureRandomSpi class, 675
security, 5, 288-292, 299-307, 638-723
access control, 299, 301-304
applets, restrictions on, 301
file access, 402
fine-tuning trust levels, policies, and permissions, 303
sandbox, 301
for application programmers, 304
architecture, 300
authentication and authorization, 204, 970-993
authentication and cryptography, 301
cryptography, 290-292
digital signatures, 289
SignedObject class, 290
digitally signed classes, 302
for end users, 305
Java VM
access restrictions, 300
byte-code verification, 300
java.security package, 204, 638-682
java.security.cert package, 682-707
java.security.interfaces package, 707-712
java.security.spec package, 712-723
message digests, 256, 288
packets, sending/receiving, 556
permissions and policies (see permissions; security policies)
risks, 300
secure HTTP (https: protocol), 258
Secure Sockets Layer (see SSL)
SecurityException, 486
SecurityManager (see SecurityManager class)
for system administrators, 305
for system programmers, 304
system properties, granting access to, 807
URLClassLoader class, 582
Security class, 676
security policies, 303
default, defined by system administrators, 305
file permissions, 402
how they work, 303
implementation by SecurityManager, 487
jstatd permissions, 362
NetPermission class, 566
Policy class, 668, 972
policytool, 369
ReflectPermission class, 541
RuntimePermission names, 486
system, user, and java.security.policy policy files, 306
user-defined, augmenting or replacing system policy, 305
SecurityManager class, 301, 487
default, automatically installing, 306
delegation of access requests to AccessController, 303
getting and setting system SecurityManager, 501
installing, 305
restrictions on applets, 302
use by FileInputStream class, 302
SecurityPermission class, 677
@see javadoc tags, 315, 318
package.html file, 319
seek( ) (RandomAccessFile), 429
select( )
ProxySelector class, 569
Selector class, 251, 618, 620
SelectableChannel interface, 617
selectedKeys( ) (Selector), 618
SelectionKey class, 618
Selector class, 273, 620
IllegalSelectorException, 612
selector classes, 204
AbstractSelectionKey class, 626
AbstractSelector class, 627
SelectorProvider class, 627
self-reflection, 283
self-signed certificate authority certificates, 366
Semaphore class, 249, 849
semicolon (see ; under Symbols)
send( )
DatagramChannel class, 605
DatagramSocket class, 556, 567
sendUrgentData( ) (Socket), 573
separator characters, 326
constants defined by File class, 397
directory, 311
line separators on different platforms, 311
separators (tokens), 21
SequenceInputStream class, 431
sequential data (see input/output; streams)
@serial javadoc tag, 316
@serialData javadoc tag, 316
@serialField javadoc tag, 316
Serializable interface, 139, 432
arrays, 75
implemented by collections and maps, 227
SerializablePermission class, 432
serialization, 286
deserialization methods, ObjectInput interface, 411
deserialization methods, ObjectInputStream, 412-413
enumerated types, 191
Externalizable interface, using, 397
JavaBeans components, 287
NotSerializableException, 411
ObjectInputStream class, 386
ObjectInputStream.GetField class, 413
ObjectInputValidation class, 414
ObjectOutput interface, 415
ObjectOutputStream class, 386, 415
ObjectOutputStream.PutField class, 416
ObjectStreamClass class, 417
ObjectStreamConstants interface, 418
ObjectStreamException, 419
ObjectStreamField class, 419
OptionalDataException, 420
SealedObject class, 292, 935
@serial javadoc tag, 316
SerializablePermission class, 432
SignedObject class, 290, 679
StreamCorruptedException, 433
warnings about inadequate documentation, 346
writing data in addition to default, 316
(see also Serializable interface)
serialPersistentFields field, 316, 412, 415
serialver program, 370
serialVersionUID field, 417
server sockets, factory classes for, 204
server version of VM (Sun HotSpot), 332
servers, 261
blocking I/O and, 273
communicating directly with, using sockets, 258
NonBlockingServer class (example), 273-276
server-side networking, 272
ServerSocket class, 261, 272, 570
ServerSocketChannel class, 621
ServerSocketFactory class, 946
Service class (Provider), 673
service provider interface, 639
algorithm-parameter generation, 643
AlgorithmParameters, 644
CertificateFactory class, 687
CertificateFactorySpi, 687
CertPathBuilderSpi, 691
CertPathValidatorSpi, 693
CertStoreSpi, 695
channel and selector implementations, 586
channels and selectors, 625-628
charset implementations, 586
charsets, 637
CipherSpi class, 926
ExemptionMechanismSPI, 929
for JAAS, 970
javax.crypto package, 921
KeyAgreementSpi class, 931
KeyFactorySpi, 655
KeyGeneratorSpi class, 933
KeyManagerFactorySpi, 953
KeyPairGeneratorSpi, 657
KeyStoreSpi, 663
KeyStoreSpi class, 663
LoginModule, for JAAS, 992
MacSpi class, 934
message-digest algorithms, 664
SecretKeyFactorySpi class, 937
secure random number generation, 675
SignatureSpi, 679
SSLContextSpi, 955
TrustManagerFactorySpi, 968
ServicePermission class, 985
servlets, 10
session IDs, SSL, 964
set( ), 252
AbstractList class, 754
ArrayList class, 758
Calendar class, 763
Field class, 534
LinkedList class, 795
List interface, 229
ListIterator interface, 756, 798
ThreadLocal class, 507
Set interface, 225, 813
AbstractSet class, 757
Collection interface methods, 226
SortedSet interface, 816
set prefix, data accessor methods, 128
setAccessible( ) (AccessibleObject), 530, 540
setAllowUserInteraction( ), 583
setAttribute( ) (TransformerFactory), 1013
setBroadcast( ), 556
setCalendar( ) (DateFormat), 734
setCertificateEntry( ) (KeyStore), 658
setCertPathCheckers( ), 699
setCertStores( ), 700
setCharAt( ) (StringBuffer), 496
setClassAssertionStatus( ), 459
setConnectTimeout( ), 583
setContentHandler( ), 1020
setContentHandlerFactory( ), 554
setContextClassLoader( ) (Thread), 502
setDaemon( ) (Thread), 502
setDatagramSocketImplFactory( ), 558
setDefault( )
Authenticator class, 551, 566
CookieHandler class, 554
ProxySelector class, 569
ResponseCache class, 569
setDefaultAllowUserInteraction( ), 583
setDefaultAssertionStatus( ), 459
setDefaultUncaughtException-Handler( ), 503, 505
setDefaultUseCaches( ), 569, 583
setDoInput( ) (URLConnection), 583
setDoOutput( ) (URLConnection), 583
setDTDHandler( ), 1020
setElementAt( ) (Vector), 824
setEnabledProtocols( ) (SSLSocket), 965
setEndRule( ) (SimpleTimeZone), 814
setEntry( ) (KeyStore), 658
setErr( ) (System), 500
setErrorHandler( ), 1023
setErrorListener( )
Transformer class, 1011
TransformerFactory class, 1013
setFeature( )
SAXParserFactory class, 1006
SchemaFactory class, 1023
Validator class, 1024
XPathFactory class, 1029
setGroupingUsed( ), 744
setHostnameVerifier( ), 951
setIfModifiedSince( ), 583
setIn( ) (System), 500
setInput( ) (Deflater), 912
setInterface( ) (MulticastSocket), 565
setKeepAlive( ) (Socket), 573
setKeyEntry( ) (KeyStore), 658
setLastModified( ) (File), 397
setLevel( ) (ZipOutputStream), 874, 919
setLineNumber( ), 410
setLocale( ) (MessageFormat), 742
setLoopbackMode( ), 565
setMaxCRLNumber( ), 706
setMaximumFractionDigits( ), 744
setMaxPathLength( ), 698
setMaxPriority( ) (ThreadGroup), 506
setMethod( ), 874
ZipOutputStream class, 919
setMinCRLNumber( ), 706
setName( )
NameCallback class, 980
Thread class, 502
setNeedClientAuth( ), 961, 965
setNetworkInterface( ), 565
setNode( ) (DOMResult), 1015
setOOBInline( ) (Socket), 573
setOption( ) (SocketOptions), 576
setOut( ) (System), 500
setOutputProperties( ) (Transformer), 1010
setOutputProperty( ) (Transformer), 1011
setPackageAssertionStatus( ), 459
setParameter( ) (Transformer), 1011
setPassword( ), 980
setPolicy( ) (Policy), 668, 677
setPriority( ) (Thread), 502
setProperties( )
System class, 500
TransformerHandler interface, 1020
setProperty( )
Properties class, 806
SAXParser class, 1005
SchemaFactory class, 1023
System class, 807
System interface, 500
TransformerHandler interface, 1020
Validator class, 1024
setReadOnly( ) (File), 397
setReadTimeout( ), 583
setReceiveBufferSize( ), 556
ServerSocket class, 570
Socket class, 572
setRequestMethod( ), 559
setResourceResolver( ), 1023
setReuseAddress( ), 556
ServerSocket class, 570
Socket class, 573
sets, 225
defined, 227
enumerated values, 225
hashtable-based, 225
immutable Set objects, 237
Set interface, 227
implementations, listed, 228
setSchema( ), 1006
setSecurityManager( ) (System), 501
setSeed( ) (SecureRandom), 675
setSendBufferSize( )
DatagramSocket class, 556
Socket class, 572
setSessionCacheSize( ), 964
setSessionTimeout( ), 964
setSoLinger( ) (Socket), 573
setSoTimeout( )
DatagramSocket class, 556
ServerSocket class, 570
Socket class, 572
setStartRule( ) (SimpleTimeZone), 814
setStrength( ) (Collator), 733
setTcpNoDelay( ) (Socket), 573
setText( ) (BreakIterator), 729
setThreadCPUTimeEnabled( ), 525
setTime( )
Calendar class, 764
Date class, 222
setTimeToLive( ), 565
setTimeZone( ) (DateFormat), 734
setTrafficClass( ) (Socket), 556, 573
setTrustAnchors( ), 700
setUncaughtExceptionHandler( ), 503, 505
setURIResolver( )
Transformer class, 1011, 1015
TransformerFactory class, 1013
setUsageThreshold( ), 522
setUseCaches( ), 583
setValue( ) (Entry), 802
setVerbose( ) (CompilationMXBean), 518
setWantClientAuth( ), 961, 965
setXIncludeAware( ), 1006
setXPathFunctionResolver( ), 1029
setXPathVariableResolver( ), 1029
severe( ) (Logger), 212
severity levels, log messages, 211
SHA (Secure Hash Algorithm), 370
shadowing superclass fields, 145
shallow copy, 84
shared file locks, 270
shared locks, 608
shift operators, 37
<< (left shift), 38
>> (signed right shift) operator, 38
combining with assignment (=) operator, 39
listed, 29
return type, 31
short type, 22, 24
comparing to float type with = = operator, 35
conversion to other primitive types, 28
Short class, 25, 217, 439, 488
unsigned values, 394
ShortBuffer class, 600
ShortBufferException, 938
shuffle( ) (Collections), 768
shutdownInput( ) (Socket), 572
shutdownOutput( ) (Socket), 572
side effects
expression
in assertion expressions, 63
in expression statements, 42
of operators, 32
order of evaluation and, 32
sign( ) (Signature), 677
signalAll( ) (Condition), 248
Signature class, 639, 677
signature, class definition, 99
GenericSignatureFormatError, 535
SignatureException, 678
signatures, digital (see digital signatures)
signatures, method, 64-66
generic, reflection on, 538
implicit this parameter, 105
varargs, converting, 69
SignatureSpi class, 679
signed numbers, 24
signed right shift operator (>>), 29, 38
SignedObject class, 290, 639, 679
Signer class, 680
signum( )
Integer class, 472
Math class, 476
simple class names, 91
SimpleDateFormat class, 747
SimpleFormatter class, 890
SimpleTimeZone class, 814
@since javadoc tags, 315
javadoc, ignoring in doc comments, 346
package.html file, 319
single-line comments, 19
singleton( ) (Collections), 237, 768
singletonList( ) (Collections), 237, 768
singletonMap( ) (Collections), 237, 768
sinh( ) (Math), 476
sink( ) (Pipe), 614
SinkChannel class (Pipe), 615
size( ), 756
AbstractCollection class, 753
AbstractList class, 754
CharArrayWriter class, 392
DataOutputStream class, 396
FileChannel class, 608
FileLock class, 610
Map interface, 801
Vector class, 824
skip( )
InputStream class, 407
Reader class, 430
Scanner class, 215
ZipInputStream class, 919
skipBytes( ) (DataInputStream), 394
slashSlashComments( ), 433
slashStarComments( ), 433
sleep( ) (Thread), 241, 250, 502
socket( ), 271
DatagramChannel class, 605
SocketChannel class, 622
SocketAddress class, 271, 574
UnresolvedAddressException, 624
SocketChannel class, 271, 272
SocketHandler class, 890
sockets
BindException, 552
client-side networking with SocketChannel, 271
ConnectException, 553
DatagramSocket class, 555
DatagramSocketImpl class, 557
DatagramSocketImplFactory, 558
factory classes for creating, 204
handle to open socket, 399
InetSocketAddress, 563
MulticastSocket class, 565
networking classes, 549
nonblocking connections, 275
ProtocolException, 568
server-side networking (New I/O API), 272
ServerSocket class, 272, 570
ServerSocketChannel, 621
ServerSocketFactory class, 946
Socket class, 258, 272, 572-574
SocketChannel, 622
SocketChannel class, 271
SocketException, 575
SocketFactory class, 947
SocketImpl class, 575
SocketImplFactory interface, 576
SocketOptions interface, 576
SocketPermission class, 577
SocketTimeoutException, 578
SSL (Secure Sockets Layer), 947-969
unable to connect to remote host, 567
SoftReference class, 528
Solaris operating system
Java interpreter, 2
JDK, download site (Sun), 7
thread type for Java interpreter and Classic VM, 333
sort( )
Arrays class, 79, 224, 759
Collections class, 237, 767
static member imports and, 93
SortedMap interface, 225, 815
TreeMap implementation, 233
SortedSet interface, 225, 816
interesting methods, 228
TreeSet class, 228
sorting collections elements, 237
source( ) (Pipe), 614, 615
-source 1.4 (javac command-line argument), 61
source code
CodeSource class, 647
converting to ASCII, 366
source files
C language, for Java native methods, 348
for classes being debugged, setting for jdb, 354, 356
path, specifying for javac compiler, 340
release of Java, specifying for, 346
search path for (javadoc), 347
specifying for javadoc to process, 342
Source interface, 280, 1009
source keyword, 339
SourceChannel class (Pipe), 615
SourceLocator interface, 1009
spaces in doc comments, 313
special effects, threads for, 241
SPI (see service provider interface)
split( ) (String), 214, 493
SSL (Secure Sockets Layer), 204, 259, 947-969
SSLContext class, 948, 954
SSLContextSpi class, 955
SSLEngine class, 948, 955
SSLEngineResult class, 957
SSLEngineResult.HandshakeStatus, 957
SSLException, 959
SSLHandshakeException, 959
SSLKeyException, 959
SSLPeerUnverifiedException, 960
SSLPermission class, 960
SSLServerSocket class, 961
SSLServerSocketFactory, 962
SSLSession class, 962
SSLSessionBindingEvent, 963
SSLSessionBindingListener, 964
SSLSessionContext, 964
SSLSocket class, 961, 964
SSLSocketFactory, 966
Stack class, 231, 816
EmptyStackException, 774
stack traces
displaying for current or specified threads, 357
for exceptions, 57
for threads, 503
jstack tool, 360
StackOverflowError, 489
stacks
LIFO queues, 234
LinkedList, using, 795
StackTraceElement class, 489
standard extensions, 89
additional information about, 204
portability conventions and rules, 311
standard input, 399, 500
standard output, 399, 500
profiling output, printing to, 337
start( )
ProcessBuilder, 483
Thread class, 239, 502
startElement( ) (SAXParser), 1005
startsWith( ) (String), 492
state
beans, 321
instance fields, 103
threads, 502, 504
writing complete object state to serialization stream, 316
State class, 504
statements, 11, 18, 42-64
assert, 60-64
break, 54
compound, 14, 43
continue, 54
defined by Java, summary of, 42
do/while, 49
empty, 43
expression, 42
flow-control, 13
return statement, 13
for, 49
for/in, 50-54
if/else, 44-46
else if clause, 45
nested, 45
labeled, 43
local variable declaration, 43
return, 55
switch, 46-48
synchronized, 55
throw, 56
exception types, 57
try/catch/finally, 58-60
while, 48
static initializers, 110
static (keyword), 10
static member types, 140, 141-143
features of, 142
implementation, 154
importing, 143
restrictions on, 143
static members, 99, 100
class fields, 102
generic types, 172
import static declaration, 184
methods, 102
static modifier, 157
abstract modifier and, 129
anonymous classes and, 153
class fields, 102
class methods, 102
fields, 101
interface methods and, 135
local classes and, 148
member classes and, 140
method lookup, 122
methods, 67
statistics, JVM (jstat tool), 360-362
Status class (SSLEngineResult), 958
stop( ) (Thread), 241, 502
store( )
KeyStore class, 658
Properties class, 806
StreamCorruptedException, 433
StreamHandler class, 891
streams
byte stream classes in java.io, 385
channels and, 601
character stream classes, 386
CipherInputStream class, 925
CipherOutputStream class, 926
class resources, 458
close( ) method and Closeable interface, 386
corrupted, 433
encrypting/decrypting, 292
FileOutputStream class, 401
filtering, 404
implementing Appendable interface, 386
in, out, and err, 399, 500
InputStream class, 407
javax.xml.transform.stream package, 995
LineNumberInputStream class (deprecated), 410
output, flush( ) and Flushable interface, 386
OutputStream class, 420
PipedInputStream class, 422
PipedOutputStream class, 422
reading primitive data types in binary format, 393
SequenceInputStream class, 431
WriteAbortedException, 437
writing Java primitive types in portable binary format, 395
writing serialized objects to, 287
XML documents, 1020-1022
(see also byte streams; character streams; input/output)
StreamTokenizer class, 433
strictfp methods, 67
strictfp modifier, 100, 157
StrictMath class, 440, 490
string concatenation operator (+), 33
string literals, 73
strings, 205-217
arrays of, 10
basic operations on, 205
CharSequence and CharBuffer interfaces, 207
comparing, 208
concatenating, 29, 33, 208, 496
converting characters to, 448
converting numbers to/from, 219
converting other data types to, 34
converting Short values to and from, 488
converting to a double, 463
converting to and from bytes, 447
converting to and from integers, 25, 472
converting to long or Long, 474
DOMStringList, 1042
equality comparisons, 493
escape sequences in string literals, 24
formatting, 741
instanceof operator, using with, 40
strings (continued )
manipulation methods, implemented in machine code, 6
pattern matching with regular expressions, 212-215
streaming data, reading from/writing to, 257
String class, 73, 205, 491-495
compareTo( ) and equals( ), 209
format( ), 69, 211, 223, 491
intern( ), 209
matches( ), 213
split( ), 214
Unicode supplementary characters, 493
StringBuffer class, 206, 495-497
methods for CharSequence objects, 496
StringBufferInputStream class, 434
StringBuilder class, 498
StringCharacterIterator class, 749
StringIndexOutOfBoundsException, 499
StringReader class, 435
StringWriter class, 257, 435
tokenizing
Scanner class, 215
StreamTokenizer, 433
StringTokenizer, 216, 817
Unicode, converting to/from bytes, 204
StringTokenizer class, 216
strongly typed languages, 11
structs (C language), 96
stub files for C language Java native method implementation, 349
subclasses, 99
of abstract classes
partial implementation, 138
implementing abstract methods, 129
concrete, 129
constructors, 116
inheritance and, 114-123
access control, 126
constructor chaining and the default constructor, 117
hiding superclass fields, 119
overriding superclass methods, 120-123
subclasses, inheritance and (continued )
superclasses and Object class, 116
Thread class, 238
subinterfaces, 136
Subject class, 974, 991
SubjectDomainCombiner class, 975
subList( ) (List), 229, 797
subMap( ) (SortedMap), 234, 815
submit( ) (ExecutorService), 244
subroutines (see methods)
subSequence( ), 492
CharSequence interface, 455
StringBuffer class, 496
subSet( ) (SortedSet), 816
Subset class, 451
substring( ), 492
StringBuffer class, 496
subtract( ) (BigDecimal), 543
subtraction operator (-), 14, 33
Sun Microsystems
HotSpot VM, 332
java, javax and sun, package names beginning with, 90
Java packages controlled by, 90
JDK download site, 7
SunJCE cryptographic provider, 922
Diffie-Hellman key-agreement algorithm, 930
key-generation implementations, 932
message authentication algorithms, 933
SecretKeyFactory implementations, supporting, 936
SunJSSE provider, 952
SunX509 algorithm, 952
super( ), 116, 117
vs. super keyword, 123
super keyword, 116, 119
overridden methods, invoking, 122
superclasses, 87, 99
containing class members, accessing, 145
fields, hiding in subclasses, 119
inheritance by subclasses of method implementations, 157
methods, overriding, 120-123
Object, class hierarchy and, 116
superinterfaces, 136
supplementary characters (Unicode), 19, 23, 209
Character class methods for, 448
String methods for, 493
@SuppressWarnings annotation, 164, 195, 440, 499
surrogate pairs (Unicode characters), 19, 23, 209, 448
suspend( ) (Thread), 502
swap( ) (Collections), 768
switch statements, 46-48
assertions in, 62
case labels, 47
data types in, 46
enumerated types and, 181
restrictions on, 48
symmetric keys, 290, 936
generating, 932
SyncFailedException, 436
synchronized methods, 245
AtomicInteger vs., 252
collections, 768
synchronized modifier, 56, 67, 157
synchronized statements, 55
verifying lock with assert statement, 63
synchronizedList( ) (Collections), 758, 795
synchronizedSet( ) (Collections), 787, 822
synchronizer utilities, 249
AbstractQueuedSynchronizer, 863
CountDownLatch, 836
CyclicBarrier, 837
synchronizing threads, 245
deadlock, avoiding, 247
IllegalMonitorStateException, 469
Object class methods, using, 479
SynchronousQueue class, 251, 850
system administrators, security for, 305
System class, 224, 440, 499-501
arraycopy( ), 79, 224
currentTimeMillis( ), 221
exit( ), 59
getenv( ), portability and, 310
identityHashCode( ), 464
nanoTime( ), 221, 500
system classes
javap tool, specifying search path for, 350
path to search for (javah), 348
portable Java code and, 311
system preferences (see preferences)
system programmers, security for, 304
system properties
access by applets, restrictions on, 302
java.security.manager, 306
Properties class, using for, 293
read/write access control, 807
system security policy, replacing with user-defined, 306
System.err, 424
systemNodeForPackage( ) (Preferences), 294
System.out, 424
System.out.println( ), 106, 255
T[ Top ]
tabs, 13
\t escape sequence in char literals, 23
taglet classes, classpath for, 347
tags
doc comment
custom, 347
inline, within HTML text, 316
listing of, 314-318
HTML, in doc comments, 313
tailMap( ) (SortedMap), 234, 815
tailSet( ) (SortedSet), 816
take( ), 251
BlockingQueue interface, 235
tanh( ) (Math), 476
@Target annotation, 201, 515
target (of an annotation), 193, 197
targets for permissions, 306, 369
NetPermission, 566
SSLPermission, 960
tasks
running and scheduling, 241-245
scheduling, 751
Templates interface, 1010, 1013
TemplatesHandler interface (SAX), 1019
temporary files
creating, 398
deleting, 113
TERMINATED thread, 239, 504
terminating lines with platform-specific separators, 311
ternary operator (?:), 29, 31, 39
testing
assertions as tool for, 60
loop variables, 49
method argument values with assert statement, 63
text, 205-217
appendability of text buffers and output streams, 207
breaks in, 729
Character class, 206
CharSequence interface, 207
encoding/decoding with charsets (see charsets)
formatting with printf( ) and format( ), 210
internationalized, 204, 724-749
logging API, 211
outputting to file, 255
pattern matching with regular expressions, 212-215
reading from a file with FileReader, 403
reading lines from a file, 254, 386
reading with FileInputStream, 400
representations of primitive data types, 424
String class, 205
string comparison, 208
string concatenation, 208
StringBuffer class, 206
supplementary characters, 209
tokenizing, 215
StringTokenizer, 216
writing to a file, 255, 403
writing with FileOutputStream, 401
text editors, 8
Text interface (DOM), 279, 1049
TextInputCallback class, 981
TextOutputCallback class, 981
this( ), 117
calling one constructor from another, 108
field initialization code and, 109
this (keyword), 104
accessing hidden field through
vs. invoking overridden method with super, 123
explicit reference to containing instance of this object, 145
invoking one constructor from another, 108
local classes, 149
Thread class, 238, 440, 502-504
holdsLock( ), 63
interrupt( ), 241
interrupted( ), 250
new features in Java 5.0, 502
sleep( ), 241
stop( ) (deprecated method), 241
UncaughtExceptionHandler, 502, 505
thread groups in debugging, 356
thread safety, collections, 236
ThreadFactory interface, 851
ThreadInfo class, 524
ThreadMXBean interface, 525
ThreadPoolExecutor class, 243, 851-853
AbortPolicy, 853
CallerRunsPolicy, 853
DiscardOldestPolicy, 854
DiscardPolicy, 854
threads, 238-252
atomic variables, 252
blocking queues, 251
coordinating, 247-250
synchronizer utilities, 249
wait( ) and notify( ), 248
waiting for another to finish, 249
waiting on a Condition, 248
creating, running, and manipulating, 238
handling uncaught exceptions, 240
lifecycle, 239
priority levels, 240
deadlocked, 247
exclusion and locking, 245-247
deadlock, 247
locks package, 246
IllegalThreadStateException, 470
inheritance, 470
InterruptedException, 473
interrupting, 250
monitoring usage in the JVM, 525
piped communication between, 257, 385, 422, 614
running and scheduling tasks, 241-245
Executor interface, 242
ExecutorService interface, 243
ScheduledExecutorService, 244
safety, 768
selecting system threading type, 333, 335
sleeping, 241
stack size, setting for interpreter, 336
stack traces, displaying with jdb, 357
suspending execution with jdb, 356
synchronized methods, 67
synchronizing, 55
CountDownLatch, 836
CyclicBarrier, 837
IllegalMonitorStateException, 469
Object class methods, 479
verifying lock with assert, 63
terminating, 241
Thread class (see Thread class)
ThreadDeath error, 505
ThreadGroup class, 505
ThreadInfo class, 524
ThreadLocal class, 507
Thread.State class, 239, 504
Thread.UncaughtExceptionHandler class, 505
throw statements, 56
declaring exceptions, 68
exception types, 57
switch statements, stopping, 47
Throwable interface, 57, 440, 507
getCause( ), 437
getStackTrace( ), 489
throwing exceptions, 16
throws clause, 66
@throws javadoc tag, 315
ticket (Kerberos), 984
time (see dates and times)
TIMED_WAITING thread, 239, 504
TimeoutException, 854
timeouts
setting for ServerSocket, 570
SSL sessions, 964
URLConnection, 583
Timer class, 242, 817
TimerTask class, 242, 818
Timestamp class, 680
time-to-live value, packets sent through multicast sockets, 565
TimeUnit class, 221, 241, 854
TimeZone class, 819
SimpleTimeZone class, 814
toArray( ) (Collection), 237, 766
toBinaryString( )
Integer class, 472
Long class, 474
toByteArray( ), 391
toCharArray( ), 493
CharArrayWriter class, 392
toChars( ) (Character), 448
toCodePoint( ) (Character), 448
toHexString( )
Integer class, 472
Long class, 474
tokenizing text, 215
Scanner class, 751
specified input stream, 433
StringTokenizer, using, 216
tokens, 18
literals and variables, 28
punctuation characters used as, 21
toLowerCase( ), 492
Character class, 448
toOctalString( )
Integer class, 472
Long class, 474
tools, 326-371
apt (annotation processing) tool, 326
extcheck, 327
jar, 329-331
jarsigner, 328
java, 332-338
javac, 338-342
javadoc, 342-348
javah, 348
javap (class disassembler), 349-351
jconsole, 352
jdb debugger, 353-357
jinfo, 357
jmap, 358
jps, 358
jsadebugd, 359
jstack, 360
jstat, 360-362
jstatd daemon, 362
keytool, 362-366
native2ascii tool, 366
pack200, 366
policytool, 369
serialver, 370
unpack200, 371
TooManyListenersException, 321, 820
toPattern( ) (ChoiceFormat), 731
toString( ), 34
Annotation interface, 512
Arrays class, 79
Byte class, 447
ByteArrayOutputStream class, 391
ByteBuffer class, 591
ByteOrder class, 592
Character class, 448
CharArrayWriter class, 392
CharSequence interface, 455
Collection interface, 226
Date class, 222, 223
Enum class, 464
enumerated types, 180
Integer class, 472
Long class, 474
Map interface, 232
MessageFormat class, 742
Object class, 132, 480
Short class, 488
StringBuffer class, 496
StringWriter class, 435
Subset class, 451
totalMemory( ), 484
toUpperCase( )
Character class, 23, 448
String class, 492
toURI( ) (File), 397
toURL( ) (URI), 579
traceInstructions( ), 484
traceMethodCalls( ), 484
traffic class for a socket, 573
transferFrom( ) (FileChannel), 269, 607
transferTo( ) (FileChannel), 269, 607
transform( )
ClassFileTransformer, 516
Transformer class, 1011
transformations (see XML)
Transformer class, 280, 1011
TransformerConfiguration-Exception, 1012
TransformerException, 1012
TransformerFactory class, 280, 1013
TransformerFactoryConfiguration-Error, 1014
TransformerHandler interface (SAX), 1020
transient fields, object serialization and, 316
transient modifier, 157
fields, 101
tree representation of XML documents, 276, 278
TreeMap class, 233, 820
trees (red-black tree structure), 228
TreeSet class, 228, 821
trigonometric functions, 217, 476
trim( ) (String), 493
trimToSize( ) (ArrayList), 758
triple-DES key, 940
truncate( ) (FileChannel), 608
trust anchor, 688, 699
PKIXParameters, 700
trust, fine-grained levels in Java 1.2, 303
trust manager, X509 certificates, 969
TrustAnchor class, 702
TrustedCertificateEntry (KeyStore), 662
TrustManager interface, 967
TrustManagerFactory class, 967
TrustManagerFactorySpi, 968
truth values (see boolean type)
try clause, 59
try/catch/finally statements, 58-60
tryLock( ) (FileChannel), 608
TSA (Timestamping Authority), 680
tutorial, Java programming, 15
twos-complement format, representing negative numbers, 37
type conversions
( ) (cast) operator, 29, 41
array type widening conversions, 75
boxing and unboxing, xvii, 69, 88, 159
buffers of bytes to buffers of characters, 263
byte to character, 393, 403, 407
character to byte, 393
OutputStreamWriter, 421
PrintWriter class, 426
collections to/from arrays, 237
converting types to strings, 34
Formatter class, 779-782
inheritance and, 115
int to string or Integer, 472
numbers to/from strings, 219
objects to byte streams, 286
primitive types, 26
listing of, 27
reference types, 86-89
Short values to and from other types, 488
strings to and from longs, 474
strings to char values, 493
Unicode strings to/from bytes, 204
type inference, 174
Type interface, 529, 541
type literals, 74
type parameters
access to, 535
annotation types and, 200
generic method, specification of, 173
generics, using without, 163
wildcards, using, 166-169
type safety
enumerated types, 179
runtime, 165
typesafe enum pattern, 190
type variables, 160
typedef keyword (C language), 97
TypeInfo interface (DOM), 1050
TypeInfoProvider class, 1024
types (see data types)
typesafe collections (see generic types)
TypeVariable interface, 541
U[ Top ]
unary operators, 29
~ (bitwise complement), 37
! (boolean NOT) operator, 36
- (negation) operator, 33
operand number and type, 31
right-to-left associativity, 30
unbounded wildcards, 542
unboxing conversions (see boxing and unboxing conversions)
uncaught exceptions in threads, 240, 505, 506
UncaughtExceptionHandler, 505
unchecked exceptions, 68
unchecked warnings, raw types and, 163
UndeclaredThrowableException, 536, 542
unicast events, 321
registering listener for, 325
Unicode, 6, 18
byte-to-character conversions, 403, 407
char data type, 22
characters in Java names, 309
CharBuffer class, 593
converting strings to/from bytes, 204
currency symbols in identifiers, 20
escape sequences, 19
escaping in char literals, 23
IllegalFormatCodePointException, 790
native2ascii tool and, 366
subsets of, 451
UnicodeBlock class, 452-454
supplementary characters, 209
Character class methods for, 448
String methods for, 493
UTF-8 encoding, 19, 267, 394
converting Latin-1 to, 270
malformed strings, 436
writing with DataOutputStream, 396
UTFDataFormatException, 436
Version 3.0 Bidirectional Algorithm, 728
versions, 23
union type (C language), 96
Universal Time (UTC), 221
Universal Unique Identifier (UUID), 823
Unix
classpath, specifying, 338
emacs text editor, 8
file and path separators, 326
Java interpreter, 2
pipes, 614
root directory, 397
threads for Java interpreter and Classic VM, 333
UnknownError, 509
UnknownFormatConversionException, 822
UnknownFormatFlagsException, 823
UnknownHostException, 578
UnknownServiceException, 578
UnmappableCharsetException, 636
unmodifiable methods (Collection), 768
UnmodifiableClassException, 517
unnamed packages, 90
unordered collection with duplicate elements (bag), 754
unpack200 tool, 371
Unpacker interface (Pack200), 876
unread( )
PushbackInputStream class, 427
PushbackReader class, 428
UnrecoverableEntryException, 681
UnrecoverableKeyException, 681
UnresolvedAddressException, 624
UnresolvedAddressTypeException, 624
UnresolvedPermission class, 681
UnsatisfiedLinkError, 509
unsigned right shift operator (>>>), 29, 38
unsigned values, reading and returning as int values, 394
UnsupportedCallbackException, 982
UnsupportedCharsetException, 636
UnsupportedClassVersionError, 509
UnsupportedEncodingException, 436
UnsupportedOperationException, 510, 766, 768, 793
until loops, 14
untrusted code, 299-304
access control, 299
fine-grained levels in Java 1.2, 303
sandbox (Java 1.0), 301
application programming, use in, 305
byte-code verification of class files, 300
unwrap( ) (SSLEngine), 955, 958
update( )
Checksum interface, 911
Cipher class, 924
MessageDigest class, 648, 664
Observable class, 804
Observer interface, 805
Signature class, 677
upper-bounded wildcards, 178
URIs (Uniform Resource Identifiers)
URI class, 578
URIResolver interface, 1015
URISyntaxException, 580
XML namespaces, 995
URLs (Uniform Resource Locators)
https:, 948
HttpsURLConnection, 951
HttpURLConnection class, 559
JarURLConnection, 564
javadoc-generated documents, 345
keystore file, 329
MalformedURLException, 564
URL class, 258, 549, 580
caching retrieved network resources, 569
URLClassLoader class, 285, 582
permissions to loaded code, 305
URLConnection class, 583-585, 948
caching retrieved network resources, 569
URLDecoder class, 585
URLEncoder class, 585
URLStreamHandler class, 569
US-ASCII charset, 267
useProtocolVersion( ), 418
user preferences (see preferences)
UserDataHandler interface (DOM), 1050
username and password, encapsulating, 567
userNodeForPackage( ) (Preferences), 294
users, security for, 305
UTC (Universal Time), 221
UTF-8 (see Unicode)
UTFDataFormatException, 436
utility classes, 750-920
packages, 204
UUID class, 823
V[ Top ]
validate( )
CertPathValidator class, 691, 693, 699
Validator class, 282, 1024
validateObject( ), 409
ObjectInputValidation class, 414
validation, XML documents, xviii, 281, 995, 1022-1026
javax.xml.validation package, 277
Schema class, 1022
SchemaFactory class, 1022
SchemaFactoryLoader class, 1023
TypeInfoProvider class, 1024
Validator class, 1024
ValidatorHandler class, 1025
validOps( )
DatagramChannel class, 606
Pipe.SourceChannel class, 616
SelectableChannel class, 615
value( ) (Target), 515
{@value} javadoc tag, 318
cross references, 318
{@value reference} javadoc tag, 318
valueBound( ), 964
valueOf( )
Byte class, 447
Double class, 463
Enum class, 464
enumerated types, 180, 191
Integer class, 472
Long class, 474
QName class, 1001
Short class, 488
values
annotation, 197
enumerated, 179
values( ), 191
Map interface, 233, 801
value-specific class bodies (enumerated types), 186-189
valueUnbound( ), 964
varargs (see variable-length argument lists)
variable-length argument lists, xvii, 69, 159
Constructor class support for, 533
differences in Java and C, 97
Method class, 538
Object... parameter, 70
variables, 11, 28
accessible to local classes, 149
assigning values to, 11
declaring
C compatibility syntax, 76
Java vs. C language, 96
placement of, 14
fields vs., 102
final modifier, 156
IllegalAccessError, 468
incrementing as side effect of ++ operator, 32
initializing, field declarationsversus, 109
local, 43
naming and capitalization, 309
local scope, local classes and, 150
loop
for/in loops, 51
initializing, testing, and updating, 49
scope of, 12, 44
storing objects in, 72
thread-local, 507
type, 160
variable type for operands, 31
XPath, 1031
vars keyword, 339
Vector class, 225, 231, 824
verify( )
Certificate class, 683
HostnameVerifier class, 951
Signature class, 677
SignedObject class, 679
X509Certificate class, 702
X509CRL class, 705
VerifyError class, 510
verifying byte code for untrusted classes, 300
verifying digital signatures, 290
jarsigner tool, 328
@version javadoc tag, 314
versions
class or classes, displaying for, 370
Java, 3
1.2, security advances in, 5
cross-compilation, 341
(see also Java 5.0)
Java interpreter, 332, 334
package specification and implementation, 481
specifying in @since javadoc tag, 315
VetoableChangeListener class, 321, 323
VetoableChangeSupport class, 324
virtual functions (C++), 122
Virtual Machine, Java (see JVM)
virtual method invocation, 122
VirtualMachineError, 510
visibility
class members, 126
local classes, 148
members, working with, 530
visibility modifiers
nonstatic member classes, 144
rules for using, 126
(see also private modifier; protected modifier; public modifier)
Void class, 511
void keyword, 10, 55, 65
volatile fields, 101, 252
volatile modifier, 157
W[ Top ]
W3C (World Wide Web Consortium)
DOM API (see DOM)
DOM (Document Object Model), 276
W3C XML Schema, 281, 1022, 1050
wait( ), 239, 250
Object class, 248, 469, 479, 502
waitFor( ), 482
WAITING thread, 239, 504
wakeup( ) (Selector), 620
waking threads, 250
warning( ) (Logger), 212
warnings
options for javac compiler, 340
turning off with @SuppressWarnings, 195, 499
unchecked, raw types and, 163
weak references, package for, 204
WeakHashMap class, 233, 529, 826
WeakReference class, 528
while loops, 14, 48
continue statement, starting new iteration, 55
continue statement used in, 60
whitespace, 19
for readability in programs, 13
whitespaceChars( ), 433
widening conversions, 26
among reference types, 130
array type, 75
reference types, 86
width (format specifier), 783
illegal, 792
wildcards
bounded
in generic methods, 172
in parameterized types, 168
file permissions, 402
in generic types, 171, 178
NetPermission targets, 566
on-demand type imports, 91
type parameter, 166-169
WildcardType interface, 542
Windows platforms, 2
classpath, setting, 338
file and path separators, 326
file permission wildcards, 402
Java interpreter, 2, 332
JDK, downloading from Sun Microsystems, 7
Notepad and WordPad text editors, 8
root directories, 397
wordChars( ) (StreamTokenizer), 433
WordPad, 8
World Wide Web Consortium (see W3C)
wrap( )
ByteBuffer class, 589
CharBuffer class, 593
DoubleBuffer class, 595
FloatBuffer class, 596
IntBuffer class, 597
ShortBuffer class, 600
SSLEngine class, 955, 958
wrapper methods (collection), 236
WritableByteChannel interface, 266, 268, 615, 624
write( ), 874
CharArrayWriter class, 392
DataOutputStream class, 396
DigestOutputStream class, 649
FileChannel class, 268, 607
FileOutputStream class, 401
FilterWriter class, 406
GatheringByteChannel, 615
GatheringByteChannel class, 611
Manifest class, 874
OutputStream class, 386, 420
PrintWriter class, 426
PutField class, 417
SelectableChannel interface, 617
SocketChannel class, 622
StringWriter class, 435
WritableByteChannel, 606, 615, 624
Writer class, 437
"Write once, run anywhere", 4, 310
write permission, 402
WriteAbortedException, 437
writeExternal( ) (Externalizable), 316, 397
WriteLock class, 869
writeObject( ), 316, 415
ObjectOutputStream class, 417, 432
Writer class, 254, 386, 437
charset encoder/decoder, 630
writeReplace( ) (Certificate), 684
writeTo( ) (CharArrayWriter), 392
writeUTF( ), 396
writing byte and character streams (see input/output)
X[ Top ]
X.500 certificates, distinguished name, 364
X.500 principals, 970, 992
X500Principal class, 992
X500PrivateCredential class, 993
X509Certificate class, 682, 702
X509CRL class, 682, 705
X509CRLEntry class, 706
X509CRLSelector class, 706
X509EncodedKeySpec interface, 723
X509ExtendedKeyManager class, 968
X509Extension interface, 707
X509KeyManager class, 968
X509KeyManager interface, 968
X509TrustManager interface, 969
XInclude markup, 1006
XML, 276-283, 994-1031
data types, 995-1000
DatatypeConfigurationException, 996
DatatypeConstants, 996
DatatypeConstants.Field, 997
DatatypeFactory, 997
Duration class, 998
XMLGregorianCalendar, 999
DTD (Document Type Definition), 1037
invalid properties exception, 792
namespaces, 1000
NamespaceContext, 1000
QName class, 1001
packages, 204, 994
new, in Java 5.0, xviii
parsers, 1001-1007
parsing with DOM, 278
parsing with SAX, 277
preference names and values as XML file, 295
transformations, 204, 277, 280, 1007-1015
DOM, 1015-1016
SAX, 1017-1020
streams, 1020-1022
validation, 281, 1022-1026
XMLConstants class, 995
XPath expressions, xviii, 283, 1026-1031
(see also DOM; SAX)
XMLDecoder class, 287
XMLEncoder class, 287
XMLFilter interface (SAX), 1062
XMLFilterImpl class (SAX), 1074
XMLFormatter class, 891
XMLReader interface (SAX), 277, 1062-1064
XMLReaderAdapter class (SAX), 1075
XMLReaderFactory class (SAX), 1076
XOR operator
^ (bitwise XOR), 29, 38
^= (bitwise XOR assignment), 29, 39
^ (boolean XOR), 29, 37
XPath, xviii, 283, 1026-1031
javax.xml.xpath package, 995
Xpath class, 1026
XPathConstants class, 1027
XPathException, 1027
XPathExpression class, 1028
XPathExpressionException, 1028
XPathFactory class, 1029
XPathFactoryConfiguration-Exception, 1029
XPathFunction interface, 1030
XPathFunctionException, 1030
XPathFunctionResolver, 1030
XPathVariableResolver, 1031
<xsl:output> tag, 1008, 1011
<xsl:param> tags, 1011
XSLT
java.xml.transform package, 280
stylesheets, 1013
applying to XML document, 281
obtaining for XML documents, 1013
Templates, 1010
transformation engine, 204
transforming XML documents, 277
Y[ Top ]
yield( ) (Thread), 502
Z[ Top ]
zero (0)
division by, 33
negative and positive zero, 26
represented by float and double types, 26
zero extension technique, 38
ZIP files, 204, 255, 751, 909-920
JAR files vs., 869
reading, 256
Zurück zu Java in a Nutshell