Preface
PART 1: Introducing Java
Chapter 1. Introduction
What Is Java?
Key Benefits of Java
An Example Program
Chapter 2. Java Syntax from the Ground Up
The Unicode Character Set
Comments
Identifiers and Reserved Words
Primitive Data Types
Expressions and Operators
Statements
Methods
Classes and Objects
Array Types
Reference Types
Packages and the Java Namespace
Java File Structure
Defining and Running Java Programs
Differences Between C and Java
Chapter 3. Object-Oriented Programming in Java
The Members of a Class
Creating and Initializing Objects
Destroying and Finalizing Objects
Subclasses and Inheritance
Data Hiding and Encapsulation
Abstract Classes and Methods
Interfaces
Inner Class Overview
Static Member Classes
Member Classes
Local Classes
Anonymous Classes
How Inner Classes Work
Modifier Summary
C++ Features Not Found in Java
Chapter 4. The Java Platform
Java Platform Overview
Strings and Characters
Numbers and Math
Dates and Times
Arrays
Collections
Types, Reflection, and Dynamic Loading
Threads
Files and Directories
Input and Output Streams
Networking
Processes
Security
Cryptography
Chapter 5. Java Security
Security Risks
Java VM Security and Class File Verification
Authentication and Cryptography
Access Control
Security for Everyone
Permission Classes
Chapter 6. JavaBeans
Bean Basics
JavaBeans Conventions
Bean Contexts and Services .TC CT1 7 "Java Programming and Documentation" .TC CT2 "Conventions" 189
Naming and Capitalization Conventions
Portability Conventions and Pure Java Rules
Java Documentation Comments
Chapter 8. Java Development Tools
appletviewer
extcheck
jar
jarsigner
java
javac
javadoc
javah
javakey
javap
jdb
keytool
native2ascii
policytool
serialver
PART 2: API Quick Reference .TC 0 "How To Use This Quick Reference" 239
Chapter 9. The java.beans Package
Chapter 10. The java.beans.beancontext Package
Chapter 11. The java.io Package
Chapter 12. The java.lang Package
Chapter 13. The java.lang.ref Package
Chapter 14. The java.lang.reflect Package
Chapter 15. The java.math Package
Chapter 16. The java.net Package
Chapter 17. The java.security Package
Chapter 18. The java.security.acl Package
Chapter 19. The java.security.cert Package
Chapter 20. The java.security.interfaces Package
Chapter 21. The java.security.spec Package
Chapter 22. The java.text Package
Chapter 23. The java.util Package
Chapter 24. The java.util.jar Package
Chapter 25. The java.util.zip Package
Chapter 26. The javax.crypto Package
Chapter 27. The javax.crypto.interfaces Package
Chapter 28. The javax.crypto.spec Package
Chapter 29. Class, Method, and Field Index
Index
INDEX:
Symbols
Symbols
+ addition operator, 34
+= operator, 35
[] array element access operator, 42
= assignment operator, 13, 40
* asterisk, 194
@author doc-comment tag, 194
@beaninfo doc-comment tag, 199
|
Boolean OR operator, 38
bitwise OR operator, 39
! Boolean NOT operator, 38
~ bitwise complement operator, 39
^
Boolean XOR operator, 38
bitwise XOR operator, 39
&
Boolean AND operator, 38
bitwise AND, 39
&& conditional AND operator, 37
? conditional operator, 41
|| conditional OR operator, 38
{} curly-brace character
{@link} doc-comment tag, 194
/ division operator, 34
// single-line comments, 10-11, 20
/* */ multiline comments, 11, 20
/** */ doc comments, 21
@exception doc-comment tag, 195
-- decrement operator, 35
@deprecated doc-comment tag, 11, 13, 198
== equality operator, 36, 73
> greater than operator, 37
>= greater than/equal to operator, 37
>++ increment operator, 33, 35
< less than operator, 37
<= less than/equal to operator, 37
() method invocation operator, 43
% module operator, 34
* multiplication operator, 34
!= not equals operator, 36
. object member access operator, 42
@param doc-comment tag, 195
@return doc-comment tag, 195
@see doc-comment tag, 196
; semicolon
in program lines, 10
separating statements, 13
@serial doc-comment tag, 198
@serialData doc-comment tag, 198
@serialField doc-comment tag, 198
<< shift operator, left, 39
>> shift operator, signed right, 40
>>> shift operator, unsigned right, 40
@since doc-comment tag, 198
} single character, 15
- substraction operator, 34
+ symbol (URLEncoder), 416
@throws doc-comment tag, 196
() type conversion or casting operator, 43
- unary minus, 35
(_) underscore, 21
$ Unicode symbol, 21
<Ye> Unicode symbol, 21
<Po> Unicode symbol, 21
@version doc-comment tag, 195
Numbers
"100% Pure Java", 192
A
<A> HTML tag, 194
abstract classes, 110-112
InstantiationError, 349
InstantiationException, 349
abstract methods
AbstractMethodError, 328
AbstractCollection class, 497
AbstractList class, 500
AbstractMap class, 500
AbstractSequentialList class, 501
AbstractSet class, 502
accept()
FileFilter interface, 293
FilenameFilter interface, 294
ServerSocket class, 407
access control, 105-108, 166, 168-171
classes implementing, 418
classes, uniting with authenication classes, 418
inheritance and, 107
java.security package, 161
java.security.acl Package, 453-456
lists, package for, 137
member accessibility, list of, 108
modifiers, 105
package for, 137
AccessControlContext class, 419
AccessControlException, 421
AccessController class, 170-171, 418, 422
AccessibleObject class, 381
ACL (Access Control List), 453
Acl interface, 453
AclEntry interface, 454
AclNotFoundException, 454
actions, 171
activeCount() (ThreadGroup), 372
activeGroupCount() (ThreadGroup), 372
add(), 502
AbstractCollection class, 497
AbstractList class, 500
Calendar class, 506
Collection interface, 508
HashSet class, 517
LinkedList class, 520
List interface, 521
ListIterator interface, 522
Set interface, 532
TreeSet class, 539
Vector class, 540
addAll()
Collection interface, 508
List interface, 521
addAttributes() (AttributedString), 479
addAttribute() (AttributedString), 479
addition (+) operator, 34
addObserver() (Observable), 528
addPropertyChangeListener(), 252, 260
addProvider() (Security), 444
addService() (BeanContextServices), 273
addShutdownHook(), 359
add() (Permissions), 441
Adler32 class, 550
after(), 506
AlgorithmParameterGenerator class, 422
AlgorithmParameterGeneratorSpi class, 423
AlgorithmParameters class, 423
AlgorithmParameterSpec interface, 470
algorithms (cryptography)
RC2 encryption algorithm, 582
RC5 encryption algorithm, 582
allAll() (Set), 532
AllPermission class, 425
animation, threads for, 150
Annotation class, 476
anonymous classes, 117, 127-130
implementation, 132
restrictions on, 129
when to use, 129
APIs (application programming interface)
Java (see Java API)
JavaBeans (see JavaBeans API)
append() (StringBuffer), 366
AppletContext, 248
AppletInitializer interface, 248
applets, 168
appletviewer for, 200-204
security and, 166
AppletStub, 248
appletviewer program, 200-204
application programmers, security for, 172
applications
client, 159
networked, 158
applyPattern()
ChoiceFormat class, 481
DecimalFormat class, 487
MessageFormat class, 491
SimpleDateFormat class, 494
arbitrary-precision integers, package for, 137
arguments, 14
arithmetic operators, 34
ArithmeticException, 330
array element access ([]) operator, 42
array literals, 67
array types, 64-70
arraycopy(), 144
arraycopy() (System), 369
ArrayList class, 502
arrays, 28, 144
Array class, 381-382
ArrayIndexOutOfBoundsException, 330
Arrays class, 497, 503
ArrayStoreException, 331
comparing, 73
copying, 71
creating, 65
multidimensional, 68
NegativeArraySizeException, 353
rectangular, 69
treated as objects, 145
using, 65
Arrays class, 144
asList() (Arrays), 503
assignment (=) operator, 40
for variables, 13
associativity, 31
asterisk (*) in doc comments, 194
Attribute class, 478
AttributedCharacterIterator interface, 477
Attribute class, 478
AttributedString class, 478-479
Attributes class, 544
Name class, 546
authentication, 168
classes implementing, 418
classes, uniting with access control classes, 418
classes used for, 161
messages transmitted with secret key, 570
package for, 137
Authenticator class, 395
@author doc-comment tag, 194
auxiliary classes, 186
available(), 299
avoidingGui(), 263
AWT programming, 178
B
BadPaddingException, 563
basic assignment (=) operator, 40
BasicPermission class, 425
BCSChild class, 279
BCSIterator class, 279
BCSSChild class, 276
BCSSProxyServiceProvider class, 276
BCSSServiceProvider class, 276
bean contexts, 181
beanbox applications, 180
beanbox tool, 179-180
BeanContext interface, 187, 264
BeanContext(), 188
BeanContextChild interface, 188, 266
BeanContextChildSupport class, 267
BeanContextContainerProxy interface, 268
BeanContextEvent class, 268
BeanContextMembershipEvent class, 269
BeanContextMembershipListener interface, 269
BeanContextProxy interface, 267, 270
BeanContextServiceAvailableEvent class, 270
BeanContextServiceProvider interface, 270
BeanContextServiceProviderBeanInfo interface, 271
BeanContextServiceRevokedEvent class, 271
BeanContextServiceRevokedListener interface, 272
BeanContextServices interface, 188, 272
BeanContextServices(), 188
BeanContextServicesListener interface, 274
BeanContextServicesSupport class, 188, 274
BCSSChild class, 276
BCSSProxyServiceProvider class, 276
BCSSServiceProvider class, 276
BeanContextSupport class, 188, 276
BCSChild class, 279
BCSIterator class, 279
BeanDescriptor class, 249
BeanInfo class, 180, 182, 252
@beaninfo doc-comment tag, 199
BeanInfo interface, 249-250
beans, 178-179
conventions for, 182
distribution/packaging, 187
(see also JavaBeans API)
Beans class, 248, 251
before(), 506
BigDecimal class, 142, 391
BigInteger class, 142, 393
binary data, reading arbitrarily, 154
binarySearch()
Arrays class, 504
Collections class, 509
BindException, 397
BitSet class, 497, 505
bitwise AND (&), 39
bitwise complement (~) operator, 39
bitwise OR (|) operator, 39
bitwise XOR (^) operator, 39
blank lines, 15
boolean AND (&) operator, 38
boolean data type, 332
Boolean class, 328, 332
boolean NOT (!) operator, 38
boolean OR (|) operator, 38
boolean type, 23
boolean XOR (^) operator, 38
booleanValue(), 332
bound properties, 180, 183, 258
break statements, 52
BreakIterator class, 476, 479
BufferedInputStream class, 280, 282
BufferedOutputStream class, 280, 283
BufferedReader class, 282-283
BufferedWriter class, 284
bugs, security-related, 7
bytes
ByteArrayInputStream class, 280
Byte class, 140
ByteArrayInputStream class, 157
byte-code, 8
JIT compilers, 342
VerifyError, 375
verification of, 167
bytes
Byte class, 328, 332
ByteArrayInputStream class, 284
ByteArrayOutputStream class, 280, 285
CharConversionException, 287
reading, 155
streams of, 154
C
C programming language, vs. Java, 8, 80
C++ programming language
features of not found in Java, 135
vs. Java, 8, 80, 82
virtual functions, 103
CA (certificate authority), 457
Calendar class, 143, 497, 506
GregorianCalendar class, 516
cancel()
Timer class, 536
TimerTask class, 537
canRead() (File), 291
canWrite() (File), 291
capacity()
ArrayList class, 502
Vector class, 540
capitalization conventions, 189
case sensitivity, 10
casts, 27
catch clause, 58
certificate authority (CA), 457
Certificate class, 457, 462
Certificate interface (java.security Package) vs., 457
CertificateRep class, 459
(see also X509Certificate class)
Certificate interface, 418, 425, 429, 451
Certificate class (java.security.cert) vs., 457
certificate revocation lists (see CRLs)
CertificateException, 459
CertificateExpiredException, 460
CertificateFactory class, 460
CertificateFactorySpi class, 461
CertificateNotYetValidException, 461
CertificateParsingException, 461
CertificateRep class, 459
certificates (identity), 457-465
Character class, 140
character sets, 8
characters, 138-140
char data type, 23, 333
Character class, 328, 333
Subset class, 335
UnicodeBlock class, 335
CharacterIterator interface, 480
CharArrayReader class, 286
CharArrayWriter class, 286
CharConversionException, 287
streams of, 154
UnsupportedEncodingException, 325
CharArrayReader class, 157
CharArrayWriter class, 157
charAt(), 365
StringBuffer class, 366
charValue(), 333
checkAccess()
Thread class, 370
ThreadGroup class, 372
CheckedInputStream class, 550
CheckedOutputStream class, 551
checkError(), 316
checkGuard() (Guard), 428
checkPermission()
AccessControlContext class, 419
AccessController class, 422
Acl interface, 453
SecurityManager class, 361
checkRead(), 168, 170
checksum
computing, 155
cryptographic-strength, 156
Checksum interface, 552
checkValidity() (X509Certificate), 462
childJustAddedHook() (BeanContextSupport), 277
childValue() (InheritableThreadLocal), 348
ChoiceFormat class, 476, 481
Cipher class, 164, 561, 563
NullCipher class, 572
CipherInputStream class, 165, 566
CipherOutputStream class, 165, 566
CipherSpi class, 566
circular dependency, 339
Class class, 147
class fields, 83
class files, 79
verification of, 167
class hierarchy, 97, 123
class methods, 84
Class objects, obtaining, 147
classes, 7, 28, 61
abstract, 110-112
access to, 106
anonymous, 117, 127-130
byte-code verification, not passing, 375
capitalization/naming conventions, 189
Class class, 328, 337
ClassCastException, 338, 511
ClassCircularityError, 339
ClassFormatError, 339
ClassLoader class, 339
ClassNotFoundException, 340
code source, 426
constructors, fields, and methods, 381
containing, 122
core, package for, 136
defining, 11, 62
conventions/rules for, 192
dynamic loading, 148
extending, 96
final, 97
IllegalAccessError, 346
IllegalAccessException, 346
importing, 77
IncompatibleClassChangeError, 347
inner, 117
how they work, 130-132
InvalidClassException, 300
LinkageError, 351
local, 117
member, 117, 119-123
members of, 82-88
NoClassDefFoundError, 353
object, 97
online documentation for, 21
Permission, 173-177
predefined, 4
programs and, 11
static member, 117-118
tool for, 225-227
undocumented, conventions/rules for, 191
UnsatisfiedLinkError, 375
UnsupportedClassVersionError, 375
version number, tool for displaying, 236
clear(), 378
Collection interface, 508
List interface, 521
Map interface, 525
Reference class, 378
client connection requests, 159
Clock class, 150
clone(), 341
Mac class, 571
MessageDigest class, 437
Object class, 356
Cloneable interface, 341
CloneNotSupportedException, 341
close(), 326
BufferedWriter class, 284
CharArrayWriter class, 286
DatagramSocket class, 399
DeflaterOutputStream class, 554
FileInputStream class, 293
FileOutputStream classes, 294
GZIPInputStream class, 555
GZIPOutputStream class, 555
InputStream class, 299
JarOutputStream class, 549
OutputStream class, 312
PrintWriter class, 316
Reader class, 320
Socket class, 407
StringWriter class, 325
ZipOutputStream class, 560
closeEntry()
ZipInputStream class, 559
ZipOutputStream class, 560
CodeSource class, 418, 426
CollationElementIterator class, 482
CollationKey class, 483
Collator class, 476, 483
RuleBasedCollator class, 494
collections, 145-147
arrays of, converting to objects, 146
classes for working with, 497-543
Collection interface, 508, 520
Collections class, 497, 509
elements of, searching/sorting, 146
immutable or unmodifiable, error, 375
Permission objects, 440
Collections methods, 146
comma in numeric values, 141
command()
Compiler class, 342
commentChar(), 323
comments, 10-11, 20
doc, 192-199
tags for, 194
Comparable interface, 341
Comparator interface, 497, 511
compare()
CollationElementIterator class, 482
Collator class, 483
Comparator interface, 511
compareTo(), 365
BigDecimal class, 391
BigInteger class, 393
CollationKey class, 483
Comparable interface, 341
comparison operators, 36
compileClass(), 342
compileClasses(), 342
Compiler class, 342
compiling programs, 10
compound statements, 16, 44
compression and decompression of data, 550-560
computing
factorials, 16
results, 14
concat(), 365
concatenating strings, 367
ConcurrentModificationException, 512, 519, 522
conditional (?) operator, 41
conditional AND (&&) operator, 37
conditional OR (||) operator, 38
configuration files, Properties class and, 146
connect()
DatagramSocket class, 399
PipedInputStream class, 313
PipedOutputStream class, 314
URLConnection class, 414
ConnectException, 398
constants, capitalization/naming conventions, 190
constrained properties, 180, 184-186, 258
changes, prohibiting, 261
conventions for, 184-186
constructors, 60, 88-90, 384
chaining, 98-100
classes, 381
default, 98
subclass, 97
containing
classes, 122
instances, 122
containment hierarchy, 123
containment protocol (JavaBeans), 187
contains()
BeanContextMembershipEvent class, 269
Collection interface, 508
HashSet class, 517
TreeSet class, 539
containsAll() (Collection), 508
containsKey()
Map interface, 525
TreeMap class, 539
containsValue() (Map), 525
ContentHandler class, 398
ContentHandlerFactory interface, 398
continue statements, 53
conventions
capitalization, 189
documentation, 189-199
for portability, 190-192
for JavaBeans, 181-187
naming, 189
copy() (Collections), 510
countTokens(), 535
CRC32 class, 550, 552
createNewFile() (File), 291
createTempFile() (File), 291
CRL class, 461
(see also X509CRL class)
CRLEntry class, 464
(see also X509CRLEntry class)
CRLException, 462
CRLs, 457
parsing from byte streams, 460
cryptographic checksum (see message digests)
cryptography, 137, 163-165, 168
algorithms, parameters for, 423
arbitrary-precision integers, using, 391
DSA and RSA public and private keys, 466
Java Cryptography Extension (JCE), 419
javax.crypto Package, 561-575
javax.crypto.interfaces Package, 576
keys, invalid, 431
keys/parameters, package for, 137
private key, 442
public and private key, 418
resources for further reading, 562
service provider, not available, 439
symmetric-key, 163
(see also encryption)
curly-brace characters ({})
in classes, 11
in main method, 13
current()
BreakIterator class, 480
CharacterIterator interface, 481
currentThread() (Thread), 370
currentTimeMillis() (System), 369
Customizer class, 181
Customizer interface, 249, 251
D
data
compressing and writing to file, 155
hiding, 104-110
streaming, 154
data accessor methods, 108-110
data types
primitive, 22-29, 332-333, 342, 345, 349, 351, 362
DataFormatException, 553
DatagramPacket class, 161, 395, 399
DatagramSocket class, 161, 399
DatagramSocketImpl class, 400
DatagramSocketImplFactory interface, 401
DataInput interface, 287
DataInputStream class, 280, 288
DataOutput interface, 289
DataOutputStream class, 280, 289
Date class, 143, 497, 512
DateFormat class, 143, 476, 484
DateFormatSymbols class, 486
dates, 143
deadlock, 151
debugger for Java, 227-231
decimal places, specifying, 391
DecimalFormat class, 476, 487
DecimalFormatSymbols class, 488
declaring variables, 13
decode()
Byte class, 332
Integer class, 349
Short class, 363
URLDecoder class, 416
decrement (--) operator, 35
decrypting data (see encrypting and decrypting data)
decryption, 163
package for, 137
default constructor, 98
defaulted() (GetField), 305
defaultReadObject(), 304, 321
defaultWriteObject() (ObjectOutputStream), 307, 321
defineClass() (SecureClassLoader), 446
definePackage() (ClassLoader class), 339
defining
classes, 11
methods, 12
deflate() (Deflater), 553
Deflater class, 550, 553
DeflaterOutputStream class, 550, 554
delete()
File class, 291, 295
StringBuffer class, 366
deleteCharAt() (StringBuffer), 366
deleteEntry() (KeyStore), 436
deleteOnExit() (File), 291
@deprecated doc-comment tag, 198
DESedeKeySpec class, 578
deserializing objects, 157
design patterns (see conventions)
DesignMode interface, 252
DESKeySpec class, 579
destroy() (Process), 358
DHGenParameterSpec class, 580
DHKey interface, 576
DHParameterSpec class, 580
DHPrivateKey interface, 577
DHPrivateKeySpec class, 580
DHPublicKey interface, 577
DHPublicKeySpec class, 581
diagrams, class-hierarchy, 97
Dictionary class, 513
Diffie-Hellman key-agreement algorithm, 567
parameters, generating set, 580
public/private keys, 137, 576, 578
three-party agreement, 568
digest() (MessageDigest), 427, 437
DigestInputStream class, 419, 427
DigestOutputStream class, 419, 427
digital signatures, 162, 169
classes for, 169
tool for, 223-225
digit(), 333
directories, 153-154
disable()
Compiler class, 342
disconnect(), 402
DatagramSocket class, 399
displaying output, 14
division (/) operator, 34
do statements, 50
doc comments, 21, 192-199
{@link} doc-comment tag, 194
body of, 193
images in, 194
for packages, 199
spaces in, 194
structure of, 193
tags for, 193-199
documentation
conventions for, 189-199
tool for, 217-221
doFinal()
Cipher class, 564
Mac class, 571
DomainCombiner interface, 428
dontUseGui(), 263
doPhase() (KeyAgreement), 568
doPrivileged() (AccessController), 422, 443
Double class, 140, 342
double data type, 342
double type, 14
doubleToLongBits(), 343
DSA and RSA public and private keys, 466
representing and encoding, 470-475
DSAKeyPairGenerator interface, 467
DSAParameterSpec interface, 471
DSAParams interface, 467
DSAPrivateKey interface, 468
DSAPrivateKeySpec interface, 471
DSAPublicKey interface, 468
DSAPublicKeySpec interface, 472
dynamic class loading, 148
dynamic loading, 147
dynamic method lookup, 102
E
elementAt() (Vector) , 540
elements()
Hashtable class, 518
Permissions class, 441
Vector class, 540
else if clause, 47
emacs text editor, 10
empty statements, 45
EmptyStackException, 514
enable() (Compiler), 342
enableReplaceObject() (ObjectOutputStream), 322
enableResolveObject() (ObjectOutputStream), 322
encapsulation, 104-110
EncodedKeySpec interface, 472
encoding, 20
tool for, 234
encrypting and decrypting data, 561-575
encryption, 163
public-key, 162
package for, 137
(see also cryptography)
end users, security for, 173
endsWith(), 365
engineSetMode() (CipherSpi), 566
engineSetPadding() (CipherSpi), 566
enqueue() (Reference), 378
ensureCapacity()
ArrayList class, 502
Vector class, 541
entries(), 558
JarFile class, 547
Entry interface (Map), 526
entrySet()
AbstractMap class, 500
Map interface, 525-526
SortedMap interface, 533
enumerate() (ThreadGroup), 372
enumeration() (Collections), 510
Enumeration interface, 514
Iterator interface vs., 519
EOFException, 290
eolIsSignificant(), 323
equality (==) operator, 36, 73
equals(), 539-540, 542
Arrays class, 504
Collator class, 483
Comparator class, 342
Hashtable class, 518
Object class, 356
equalsIgnoreCase(), 365
Error class, 328, 343
errors (see exceptions)
escape characters, 23
evaluation, order of, 33
event models, conventions/rules for, 192
EventListener interface, 180, 252
EventObject class, 180
events, 180
bean-context related, 268
conventions for, 185
EventListener, 515
EventObject class, 515
EventSetDescriptor class, 252
notifying of new service class, 270
examples in this book available online, xv
@exception doc-comment tag, 195
exceptions, 17, 55-57
certificates, 459
Exception class, 328, 344
ExceptionInInitializerError, 344
IllegalMonitorStateException, 347
Throwable interface, 328, 374
exec() (Runtime), 191, 295, 359
exists() (File), 291
exit()
Runtime class, 359
System class, 369
exitValue() (Process), 358
export regulations (cryptographic technology), 561
expressions, 29
combining, caution with, 35
statements, 44
extcheck utility, 204-206
Externalizable interface, 290
F
FeatureDescriptor class, 248-249, 252-253, 256
fields
capitalization/naming conventions, 190
classes, 381
defaults, 90-92
Field class, 384
FieldPosition class, 489
input, output, and error (system), 369
NoSuchFieldError, 354
NoSuchFieldException, 354
shadowing, 100
File class, 153
file protocol, 158
file separators, 200
file structure, 78
FilenameFilter interface, 294
filenames, 11
hardcoded, 192
files, 153-154
class, 79
File class, 280, 290
FileDescriptor class, 292
FileFilter interface, 293
FileInputStream class, 280, 293, 296
FilenameFilter interface, 280, 294
FileNameMap interface, 401
FileNotFoundException, 294
FileOutputStream class, 280, 294
FilePermission class, 295
FileReader class, 296
FileWriter class, 296
RandomAccessFile class, 280, 319
text, reading, 154
ZipFile class, 558
fill()
Arrays class, 504
Collections class, 510
fillInStackTrace(), 374
FilterInputStream class, 280
CheckedInputStream class, 550
FilterOutputStream class, 280, 297
FilterReader class, 297
FilterWriter class, 298
final classes, 97
final methods, static method lookup and, 103
finalization, 92-95
finalize() (Object), 356
finalizers, 94
chaining and, 99
finally clause, 58
findClass() (ClassLoader), 339
findEditor() (PropertyEditorManager), 260
findResource() (ClassLoader), 340
findResources() (ClassLoader), 340
firePropertyChange(), 258, 260
fireVetoableChange(), 262
first()
BreakIterator class, 480
CharacterIterator interface, 480
SortedSet interface, 534
firstKey() (SortedMap), 533
floating-point data types, 137, 141, 323, 391
Float class, 140, 328, 345
floatToIntBits(), 345
floatValue(), 345
flush(), 326
BufferedOutputStream class, 283
BufferedWriter class, 284
CharArrayWriter class, 286
CipherOutputStream class, 566
DataOutputStream class, 289
OutputStream class, 312
PrintWriter class, 316
StringWriter class, 325
following() (BreakIterator), 480
for statements, 51
forClass() (ObjectStreamClass), 309
forDigit(), 333
format()
ChoiceFormat class, 481
DateFormat class, 485
Format class, 490
MessageFormat class, 490
NumberFormat class, 492
Format class, 490
forName() (Class), 337, 339
freeMemory(), 359
ftp: protocol, 158
functions (see methods)
G
garbage collection, 74, 92
OutOfMemoryError, 357
system, 369
WeakHashMap class, 542
garbage collector, Java programs and, 377
gc(), 359
System class, 369
gcd(), 393
GeneralSecurityException, 428
generateCertificates() (CertificateFactory), 460
generateCertificate() (CertificateFactory), 460, 462
generateCRLs() (CertificateFactory), 460
generateCRL() (CertificateFactory), 460, 463
generateKey() (KeyGenerator), 570
generateKeyPair() (KeyPairGenerator), 467
generateParameters() (AlgorithmParameterGenerator), 422
generatePrivate() (KeyFactory), 432
generatePublic() (KeyFactory), 432
generateSecret()
KeyAgreement class, 568
SecretKeyFactory class, 574
generateSeed() (SecureRandom), 447
generating quick reference material, xvi
genKeyPair() (KeyPairGenerator), 434
get(), 414, 500
Array class, 382
ArrayList class, 502
Calendar class, 506
Field class, 384
GetField class, 305
HashMap class, 516
Hashtable class, 518
LinkedList class, 520
List interface, 521
Map interface, 525
PhantomReference class, 378
Reference class, 378
ReferenceQueue class, 379
ThreadLocal class, 373
TreeMap class, 539
WeakHashMap class, 542
get accessor method, 181
getAbsoluteFile() (File), 291
getAbsolutePath() (File), 291
getAddress() (InetAddress), 403
getAlgorithm() (Key), 431
getAllAttributeKeys() (AttributedCharacterIterator), 477
getAllByName() (InetAddress), 403
getAttribute() (AttributedCharacterIterator), 477
getAttributes()
AttributedCharacterIterator interface, 477
JarEntry class, 546
Manifest class, 549
getAvailableIDs() (TimeZone), 537
getAvailableLocales(), 524
Collator class, 483
NumberFormat class, 491
getBeanContextProxy() (BeanContextProxy), 267, 270
getBeanDescriptor(), 250
getBeanInfo(), 255
getBeginIndex()
CharacterIterator interface, 481
FieldPosition class, 489
getBoolean(), 332
getBuffer() (StringWriter), 325
getBundle(), 531
getByName(), 403
getCanonicalFile() (File), 291
getCanonicalPath() (File), 291
getCertificate() (KeyStore), 435
getCertificateChain() (KeyStore), 435
getCertificates() (JarEntry), 546
getCharacterInstance() (BreakIterator), 479
getChecksum()
CheckedInputStream class, 551
CheckedOutputStream class, 552
getClass()
Class class, 337
Object class, 356
getClassName(), 527
getCollationElementIterator(), 482
getCollationKey(), 483
Collator class, 484
getConstructor() (Class), 384
getContainer() (BeanContextContainerProxy), 268
getContent()
ContentHandler class, 398
URL class, 412
URLConnection class, 414
getContentEncoding(), 414
getContentLength(), 414
getContents() (ListResourceBundle), 523
getContentType(), 414
getContext() (AccessController), 419, 422
getCurrencyInstance() (NumberFormat), 491
getCurrentServiceClasses() (BeanContextServices), 272
getCurrentServiceSelectors()
BeanContextServiceAvailableEvent class, 270
BeanContextServices interface, 272
getDate() (URLConnection), 414
getDateInstance() (DateFormat), 484
getDateTimeInstance() (DateFormat), 484
getDeclaringClass()
Field class, 384
Member interface, 386
Method class, 385
getDefault()
Locale class, 524
TimeZone class, 537
getDefaultEventIndex(), 250
getDefaultPropertyIndex(), 250
getDisplay methods (Locale), 524
getEncoded()
AlgorithmParameters class, 423
Certificate class, 457
Key interface, 431
getEncoding()
InputStreamReader class, 300
OutputStreamWriter class, 312
getEndIndex()
CharacterIterator interface, 481
FieldPosition class, 489
getEntries() (Manifest), 549
getEntry() (ZipFile), 558
getenv() (Systems), 191
getEventSetDescriptors(), 250
getException() (PrivilegedActionException), 443
getExceptionTypes(), 384, 387
getExpiration(), 414
getFD(), 292
getField() (ObjectStreamClass), 309
GetField class, 305
getFields() (ObjectStreamClass), 309
getFile(), 412
getFormat()
Key interface, 431
SecretKey interface, 573
getHeaderField(), 414
getHeaderFieldDate(), 414
getHeaderFieldInt(), 414
getHost(), 412
getIcon() (SimpleBeanInfo), 250
getID() (TimeZone), 537
getIndex()
CharacterIterator interface, 481
ParsePosition class, 493
getInetAddress()
DatagramSocket class, 399
Socket class, 407
getInfo() (Provider), 444
getInputStream()
JarFile class, 547
Process class, 358
Socket class, 407
URLConnection class, 414
ZipFile class, 558
getInstance()
AlgorithmParameterGenerator class, 422
Calendar class, 506, 516
CertificateFactory class, 460
Cipher class, 563
Collator class, 483, 494
DateFormat class, 485
KeyAgreement class, 567
KeyGenerator class, 569-570
KeyPairGenerator class, 434, 467
KeyStore class, 435
Mac class, 570
MessageDigest class, 437
SecretKeyFactory class, 573
SecureRandom class, 446
Signature class, 448
getInstanceOf() , 251
getInstance()
CertificateFactory class, 460
Collator class, 140, 483, 494
DateFormat class, 485
KeyPairGenerator interface, 467
NumberFormat class, 491
getInt()
Array class, 382
getInteger(), 349
getInterfaces(), 337
getInvocationHandler() (Proxy), 389
getISOCountries() (Locale), 524
getISOLanguages() (Locale), 524
getIterator() (AttributedString), 479
getIV() (Cipher), 564
getJarEntry() (JarFile), 547
getKey(), 527
Entry interface, 526
KeyStore class, 435
getKeys()
ListResourceBundle class, 523
ResourceBundle class, 531
getKeySpec()
KeyFactory class, 432
SecretKeyFactory class, 574
getLastModified(), 414
getLength() (Array), 383
getLineInstance() (BreakIterator), 479
getLineNumber() (LineNumberReader), 302
getLocalHost() (InetAddress), 403
getLocalPort(), 399
Socket class, 407
getLong(), 351
getMacLength() (Mac), 571
getMainAttributes() (Manifest), 549
getManifest()
JarFile class, 547
JarInputStream class, 548
getMessage()
Error class, 343
Exception class, 344
Throwable interface, 374
WriteAbortedException, 326
getMethod() (Class), 387
getMethodDescriptors(), 250
getModifiers(), 388
Field class, 384
Member interface, 386
getModulus() (RSAKey), 468
getName()
Class class, 337
Field class, 384
File class, 291
Member class, 386
Member interface, 386
Provider class, 444
getNextEntry()
JarInputStream class, 548
ZipInputStream class, 559
getNextJarEntry() (JarInputStream), 548
getNextUpdate() (X509CRL), 463
getObject()
GuardedObject class, 429
ResourceBundle class, 531
SealedObject class, 572
SignedObject class, 450
getObjectStreamClass() (GetField), 305
getOffset() (TimeZone), 537
getOption() (SocketOptions), 410
getOutputSize() (Cipher), 564
getOutputStream()
Process class, 358
Socket class, 407
URLConnection class, 414
getPackage()
ClassLoader class, 339
Package class, 357
getPackages() (Package), 357
getParameters() (Cipher), 564
getParameterTypes(), 384, 387
getParams() (DHKey), 576
getParent()
File class, 291
ThreadGroup class, 372
getParentFile() (File), 291
getPassword() (PasswordAuthentication), 406
getPasswordAuthentication() (Authenticator), 396
getPath() (File), 291
getPercentInstance() (NumberFormat), 491
getPermission(), 421
getPermissions()
Policy class, 441
SecureClassLoader class, 446
getPolicy() (Policy), 441, 448
getPort(), 412
DatagramSocket class, 399
Socket class, 407
getPropagatedFrom() (BeanContextEvent), 268
getProperty()
Properties class, 528
System class, 368
System interface, 529
getPropertyDescriptors(), 250
getProtectionDomain() (Class), 444
getProtocol(), 412
getProviders() (Security), 448
getProxyClass() (Proxy), 388
getPublicKey()
Certificate class, 457
X509Certificate class, 462
getRef(), 412
getRequesting(), 397
getResource(), 188
BeanContext interface, 264
ClassLoader class, 339
getResourceAsStream(), 188
BeanContext interface, 264
ClassLoader class, 339
getResources() (ClassLoader), 339
getResponseCode(), 402
getResponseMessage(), 402
getReturnType(), 387
getRevokedCertificate() (X509CRL), 463
getRunLimit() (AttributedCharacterIterator), 477
getRunStart() (AttributedCharacterIterator), 477
getRuntime(), 359
getSecurityManager() (System), 369
getSentenceInstance() (BreakIterator), 479
getSerialVersionUID()(ObjectStreamClass), 309
getService(), 188
BeanContextServiceProvider interface, 270
BeanContextServices interface, 272-273
getServiceClass()
BeanContextServiceAvailableEvent class, 270
BeanContextServiceRevokedEvent class, 271
getServicesBeanInfo() (BeanContextServiceProviderBeanInfo), 271
getSource() (EventObject), 515
getSourceString()
CollationKey class, 483
getSpecificationVersion() (Package), 357
getString() (ResourceBundle) , 531"
getStringArray() (ResourceBundle), 531
getSubjectDN() (X509Certificate), 457, 462
getSuperclass(), 337
getTargetException() (InvocationTargetException), 386
getThisUpdate() (X509CRL), 463
getThreadGroup() (Thread), 370
getTimeInstance() (DateFormat), 484
getTimeZone() (TimeZone), 537
getType()
Character class, 333
Field class, 384
getUndeclaredThrowable() (UndeclaredThrowableException), 389
getValue()
CheckedInputStream class, 551
CheckedOutputStream class, 552
Checksum interface, 552
Entry interface, 526
getVersion() (Provider), 444
getWordInstance() (BreakIterator), 479
getX() (DHPrivateKey), 577
getY() (DHPublicKey), 577
graphical user interfaces (see GUIs)
greater than (>) operator, 37
greater than/equal to (=>) operator, 37
GregorianCalendar class, 516
Group interface, 455
Guard interface, 428
GuardedObject class, 419, 429
guessContentTypeFromName() (URLConnection), 401
GUIs
beans, specifying need for , 263
components, 178
GZIPInputStream class, 555
GZIPOutputStream class, 555
H
halt(), 359
handleGetObject()
ListResourceBundle class, 523
ResourceBundle class, 531
hardcoded filenames, conventions/rules for, 192
hasChanged() (Observable), 527
hashCode()
Hashtable class, 518
Object class, 356
HashMap class, 145, 516
HashSet class, 517
Hashtable class, 518
hasMoreElements()
Enumeration class, 514
StringTokenizer class, 535
hasMoreTokens() (StringTokenizer), 535
hasNext(), 501
Iterator class, 497
Iterator interface, 519
ListIterator interface, 522
hasPrevious(), 501
ListIterator interface, 522
hasService(), 188
BeanContextServices interface, 272
headMap() (SortedMap), 533
headSet() (SortedSet), 534
hierarchy
class, 123
containment, 123
HTML tags in doc comments, 192, 194
http: protocol, 158
HttpURLConnection class, 402
I
identifiers, 21
identity certificates (see certificates)
Identity class, 429
identityHashCode() (System), 369
IdentityScope class, 430
if/else statements, 46
IllegalAccessError, 346
IllegalAccessException, 346
IllegalArgumentException, 346
IllegalBlockSizeException, 567
IllegalMonitorStateException, 347
IllegalStateException, 347
IllegalThreadStateException, 347
images in doc comments, 194
implementations, 131
conventions/rules for, 191
implies()
AllPermission class, 425
BasicPermission class, 425
CodeSource class, 426
Permission class, 439
PermissionCollection class, 440
Permissions class, 441
ProtectionDomain class, 444
IncompatibleClassChangeError, 347
increment (++) operator, 33, 35
inDaylightTime() (TimeZone), 537
index(), 501
indexed properties, 180
IndexedPropertyDescriptor class, 254
indexOf()
List interface, 521
String class, 365
IndexOutOfBoundsException, 348
InetAddress class, 395, 403
inflate() (Inflater), 556
Inflater class, 550, 556
InflaterInputStream class, 550, 556
InfoBus standard extension, 179
InheritableThreadLocal class, 348
inheritance, 95-104
vs. scope for member classes, 123
init()
Cipher class, 564
KeyAgreement class, 568
KeyGenerator class, 569
Mac class, 571
initialization vectors (Cipher), 564, 581
initialize() (KeyPairGenerator), 434, 467
initializeBeanContextResources() (BeanContextChildSupport), 267
initializers, 90-92
ExceptionInInitializerError, 344
IllegalAccessException, 346
initialValue() (ThreadLocal), 373
initSign() (Signature), 449
initVerify() (Signature) , 449
inner classes, 117
how they work, 130-132
input
parsing, 13
reading lines of, 154
valid, checking for, 15
input streams, 154-158
BufferedInputStream class, 280, 282
ByteArrayInputStream class, 280, 284
CheckedInputStream class, 550
CipherInputStream class, 566
DataInputStream class, 280, 288
FileInputStream class, 280, 293, 296
FilterInputStream class, 280
GZIPInputStream class, 555
InflaterInputStream class, 550, 556
InputStream class, 280, 299
InputStreamReader class, 300
JarInputStream class, 548
LineNumberInputStream class, 302
ObjectInputStream class, 282, 304
package for, 136
PipedInputStream class, 280, 313
PushbackInputStream class, 318
SequenceInputStream class, 321
StreamCorruptedException, 322
system, 369
ZipInputStream class, 559
input strings
StringBufferInputStream class, 324
InputStream class, 154
insert() (StringBuffer), 366
insertProviderAt() (Security), 444
instance fields, 85
instance methods, 85-88
instanceof operator, 42
instantiate(), 248
Beans class, 251
instantiateChild() (BeanContext), 264
InstantiationError, 349
InstantiationException, 349
int data type, 349
intBitsToFloat(), 345
Integer class, 140, 328, 349
integers, 24
arbitrary-precision, math, 391
BigInteger class, 393
interfaces, 112-116
capitalization/naming conventions, 189
defining, 112
extending, 116
implementing, 113
InstantiationError, 349
marker, 116
multiple, implementing, 116
using/when to use, 114
InternalError, 350
internationalization, 8
applications, package for, 137
interrupt()
Thread class, 370
ThreadGroup class, 372
InterruptedException, 350
InterruptedIOException, 300, 400, 407
introspection (JavaBeans), 180
IntrospectionException, 254
Introspector class, 180, 248, 250, 255
InvalidClassException, 300
InvalidKeyException, 431
InvalidKeySpecException, 472
InvalidObjectException, 301
InvalidParameterException, 431
InvalidParameterSpecException, 473
InvocationHandler interface, 381, 385
InvocationTargetException, 386
invoke(), 387, 389
InvocationHandler interface, 385
invoking methods, 12
IOException, 301
isAbsolute() (File), 291
isAbstract(), 388
isAlive() (Thread), 370
isCompatibleWith() (Package), 357
isCurrentServiceInvalidNow() (BeanContextServiceRevokedEvent), 271
isDesignTime(), 188, 251
isDirectory() (File), 291
isEmpty()
Collection interface, 508
Map interface, 525
isEnqueued() (Reference), 378
isFile() (File), 291
isGuiAvailable(), 251
isHidden() (File), 291
isInfinite()
Double class, 342
Float class, 345
isInstanceOf() (Bean), 251
isInterface() (Class), 337
isInterrupted() (Thread), 370
isNaN()
Double class, 342
Float class, 345
isProbablePrime(), 393
isPropagated() (BeanContextEvent), 268
isProxyClass() (Proxy), 389
isPublic(), 388
isRevoked() (CRL), 461, 463
isSealed() (Package), 357
iterations, 17
iterator(), 534
AbstractCollection class, 497
BeanContextMembershipEvent class, 269
List interface, 521
Set interface, 526
Iterator interface, 145, 497, 519
IvParameterSpec class, 581
J
J2EE (Java 2 Platform, Enterprise Edition), 6
JAR files, 169
archive, conventions for, 187
classes for reading and writing files, 544-549
files, retrieving, 404
manifest, format of, 544
package for, 137
tools for, 204-208
JarEntry class, 544, 546
JarException, 547
JarFile class, 544, 547
JarInputStream class, 544, 548
JarOutputStream class, 544, 548
jarsigner tool, 206-208
JarURLConnection class, 404, 544
Java, 3-8
benefits of, 6-8
vs. C programming language, 8, 80
vs. C++ programming language, 8, 80, 82
case sensitivity, 10
files, 153-154
learning, 20
object-oriented programming in, 82-135
performance, 8
programmers and, 4
version 1.0, 5
access control, 168
version 1.1, 5
classes, digitally signed, 169
security and, 167
version 1.2, 5
access-control architecture, 170
array-manipulation methods, 144
collections, 145
File class, 153
permissions/policies, 170
policy file, additional, 173
programs, running, 79
version 1.3, 6
Java 2 Platform, 5
Enterprise Edition, 6
Micro Edition, 6
security, 7
Java Activation Framework standard extension, 179
Java API, 14, 166
Java Cryptography Extension (JCE), 168, 419, 561
Java Development Kit (see SDK)
.java file extension, 78
Java in a Nutshell, companion books, xi
Java interpreter, 4, 208-213
InternalError, 350
Java program, 10
OutOfMemoryError, 357
running programs, 79
StackOverflowError, 363
Java platform, 4, 136-165
Standard Edition, 6
Java Plug-in, 6
Java programming
commercial products for, 9
conventions for, 189-199
example program, 9-18
language, 3
online resources, xiv
online tutorial, 17
programs
classes and, 11
compiling, 10
running, 10
syntax, 19-81
Java Runtime Environment (see JRE)
Java virtual machine
UnknownError, 374
VirtualMachineError, 376
Java VM (Java Virtual Machine), 4
Microsoft implementation, security and, 167
security, 167
java.awt package, 178
java.awt.peer package, conventions/rules for, 191
JavaBeans API, 178-188
BeanDescriptor class, 249
BeanInfo interface, 250
beans, 178
Beans class, 251
components, 178
conventions for, 179, 181-187
Customizer interface, 251
EventSetDescriptor class, 252
Feature Descriptor class, 253
IndexedPropertyDescriptor class, 254
IntrospectionException, 254
Introspector class, 255
MethodDescriptor class, 255
objects, package for, 136
ParameterDescriptor class, 256
PropertyChangeEvent class, 256
PropertyChangeListener interface, 257
PropertyChangeSupport class, 258
PropertyDescriptor class, 258
PropertyEditor interface, 259
PropertyEditorManager class, 260
PropertyEditorSupport class, 260
PropertyVetoException, 261
SimpleBeanInfo class, 261
VetoableChangeListener interface, 256, 262
VetoableChangeSupport class, 262
Visibility interface, 263
java.beans package, 136, 178, 248-263
java.beans.beancontext packages, 136, 178, 181, 187, 264-279
javac compiler, 10, 213-216
javadoc program, 21, 217-221
HTML documentation, creating, 192
javah program, 221
java.io package, 136, 154, 156-157, 280-327
objects, serializing/deserializing, 157
javakey program, 169, 223-225
java.lang package, 136, 140, 328-376
java.lang.ref package, 136, 377-380
java.lang.reflect package, 137, 147, 381-390
java.math package, 137, 142, 391-394
java.net package, 137, 158, 395-417
javap class disassembler, 225-227
java.policy file, 172
java.security package, 137, 156, 161, 163, 169, 418-452
java.security.acl package, 137, 453-456
java.security.cert package, 137, 457-465
java.security.interfaces package, 137, 466-469
java.security.spec package, 137, 470-475
java.text package, 137, 476-496
java.util package, 137, 145, 497-543
java.util.jar package, 137, 544-549"
java.util.zip package, 137, 155, 550-560
javax.activation package, 179
javax.crypto package, 137, 163, 168, 561-575
javax.crypto.interfaces Package, 137, 576
javax.crypto.spec package, 137, 578-583
javax.infobus package, 179
javax.swing package, 178
JCE (Java Cryptography Extension), 168, 419, 561
jdb debugger, 227-231
JDK (see SDK)
JIT compiler, 4, 342
join() (Thread), 151, 370
joinGroup() (MulticastSocket), 405
JRE (Java Runtime Environment), 6
just-in-time (JIT) compilation, 4
JVM (see Java VM)
K
Key interface, 431
key-agreement algorithms, 567
KeyAgreement class, 567
KeyAgreementSpi class, 569
KeyException, 432
KeyFactory class, 432
KeyFactorySpi class, 433
KeyGenerator class, 561, 569
KeyGeneratorSpi class, 570
KeyPair class, 434
KeyPairGenerator class, 418, 434
KeyPairGeneratorSpi class, 435
keys() (Hashtable), 518
keys (cryptography)
DES key, 579
secret keys (symmetric), generating, 569
SecretKey interface, 573
triple-DES key (DESede), 578
keySet()
Map interface, 525
SortedMap interface, 533
KeySpec interface, 473
keystore, 231
KeyStore class, 418, 429, 435, 451
KeyStoreException, 436
KeyStoreSpi class, 437
keytool program, 163, 231-234
L
labeled statements, 45
language constructs, 42
languages
European, numbers in, 141
lexically scoped, 126
non-English, 8
pass-by-reference, 74
pass-by-value, 74
last()
BreakIterator class, 480
CharacterIterator interface, 480
SortedSet interface, 534
last-in-first-out (LIFO) stacks, 535
lastIndexOf(), 365
List interface, 521
lastKey() (SortedMap), 533
lastModified() (File), 291
LastOwnerException, 455
leaveGroup() (MulticastSocket), 405
left shift (<<) operator, 39
left-to-right associativity, 31
legacy collections, 146
length()
File class, 291
String class, 365
less than (<) operator, 37
less than/equal to (<=) operator, 37
lexical scoping, 126
java.policy file, 172
LIFO (last-in-first-out) stacks, 535
line separators, conventions/rules for, 192
lineno(), 323
LineNumberInputStream class, 302
LineNumberReader class, 302
lines, blank, 15
{@link} doc-comment tag, 194, 197
LinkageError, 351
LinkedList class, 520
list()
File class, 291, 294
Properties class, 528
List interface, 497, 501, 520-521, 541
listeners
BeanContextMembershipListener interface, 269
BeanContextServiceRevokedListener, 272
BeanContextServicesListener, 274
EventListener, 515
managing list of, 260
PropertyChangeListener interface, 248, 252, 257
TooManyListenersException, 538
VetoableChangeListener interface, 256, 262
listFiles() (File), 291
ListIterator interface, 145, 497, 522
listIterator()
AbstractSequentialList class, 501
List interface, 521
ListResourceBundle class, 523
listRoots() (File), 291
lists, 145
literals, 29
load()
KeyStore class, 435
Properties class, 528
Runtime class, 359
loadClass()
ClassLoader class, 339
URLClassLoader class, 413
loadImage() (SimpleBeanInfo), 261
loadLibrary(), 359
System class, 369
load() (System), 369
local classes, 117, 124-127
implementation, 132
local variable scope and, 126
restrictions on, 125
scope of, 126
local variables, 45
capitalization/naming conventions, 190
scope of, 126
Locale class, 524
locks on objects, 151
Long class, 140, 328, 351
longBitsToDouble(), 343
lookup() (ObjectStreamClass), 309
looping, 16
lowerCaseMode(), 323
M
MAC, 561, 570
(see also Mac class)
Mac class, 561, 570
MacSpi class, 572
main() method, 12
MalformedURLException, 404
Manifest class, 549
Map interface, 497, 525
Entry interface, 526
SortedMap interface, 533
TreeMap class, 539
WeakHashMap class, 542
mapLibraryName() (System), 369
maps, 145
mark()
CertificateFactory class, 460
CharArrayReader class, 286
InputStream class, 299
Reader class, 320
StringReader class, 324
marker interfaces, 116
markSupported()
InputStream class, 299
Reader class, 320
math, 140-143
Math class, 142, 328, 352
ArithmeticException, 330
max() (Collections), 510
member classes, 117, 119-123
implementation, 131
scope vs. inheritance, 123
(see also inner classes)
Member interface, 386
members, 11
access to, 106
rules, list of, 108
of classes, 82-88
members (class), 381
memory
allocation, 74
leaks, 93
OutOfMemoryError, 357
Runtime class and, 359
message authentication code (see MAC ; Mac class)
message digests, 156, 161, 168
MessageDigest class, 418, 437
MessageDigestSpi class, 438
MessageFormat class, 476, 490
messages, checking for tampering with, 161
method invocation (()) operator, 43
method parameters, 12
methods, 59-61, 110-112
AbstractMethodError, 328
capitalization/naming conventions, 190
classes, 381
Collections, 146
data accessor, 108-110
defining, 12
end of, 15
final, static method lookup and, 103
IllegalAccessError, 346
IllegalArgumentException, 346
IllegalStateException, 347
JavaBeans and, 180, 186
main() , 12
Method class, 387
MethodDescriptor class, 255
NoSuchMethodError, 354
NoSuchMethodException, 354
overriding, 101-104
invoking overridden, 103
parameters for, 12
synchronized, 151
unsupported, error, 375
Microsoft Windows (95/98/NT), SDK for, 9
MIME types, 398, 401
min() (Collections), 510
MissingResourceException, 527
mkdir() (File), 291
mkdirs() (File), 291
Modifer class, 381
modifiers, 11
list of, 132-134
Modifier class, 388
modInverse(), 393
modPow(), 393
modulo (%) operator, 34
MS-DOS window, 10
MulticastSocket class, 395, 405
multidimensional arrays, 68
multiline comments (/* */), 11, 20
multiple interfaces, 116
multiplication (*) operator, 34
N
Name class, 546
namespace, 76-78
naming conventions, 189
narrowing conversions, 27
native methods
conventions/rules for, 190
tool for, 221
native2ascii program, 234
nCopies() (Collections), 510
needsGui(), 263
NegativeArraySizeException, 353
NetPermission class, 405
network-centric programming, 7
networking, 158-161
java.net Package, 395-417
package for, 137
new operator for object creation, 43
newInstance(), 337
Array class, 383
Constructor class, 384
URLClassLoader class, 413
newLine() (BufferedWriter), 284
newPermissionCollection() (Permission), 440
newProxyInstance() (Proxy), 389
next(), 501
CharacterIterator interface, 480
CollationElementIterator class, 482
Iterator class, 497
Iterator interface, 519
ListIterator interface, 522
nextBoolean() (Random), 530
nextBytes()
Random class, 530
SecureRandom class, 447
nextDouble(), 530
nextElement()
Enumeration class, 514
StringTokenizer class, 535
nextFloat(), 530
nextGaussian(), 530
nextIndex() (ListIterator), 522
nextInt(), 530
nextLong(), 530
nextToken(), 323
StringTokenizer class, 535
NoClassDefFoundError, 353
NoRouteToHostException, 406
NoSuchAlgorithmException, 439
NoSuchElementException, 522, 527
NoSuchFieldError, 354
NoSuchFieldException, 354
NoSuchMethodError, 354
NoSuchMethodException, 354
NoSuchPaddingException, 572
NoSuchProviderException, 439
not equals (!=) operator, 36
NotActiveException, 303
Notepad, 10
notify() (Object), 152, 347, 356, 370
notifyAll() (Object), 356
NotOwnerException, 455
NotSerializableException, 303
null reference, 74
NullCipher class, 572
NullPointerException, 355
NumberFormat class, 476
numbers, 140-143, 530
comparing (Comparator class), 511
DateFormat class, 484
DecimalFormat class, 487
Enumeration class, 514
Number class, 355
NumberFormat class, 491
NumberFormatException, 355
SimpleDateFormat class, 494
numeric values, 141
O
Object class, 328
object classes, 97
object creation, operator for, 43
object identifier (OID), 464
object literals, 63
object member access (.) operator, 42
object serialization
Externalizable interface, 290
NotSerializableException, 303
ObjectInput interface, 303
ObjectInputStream class, 282, 304
GetField class, 305
ObjectInputValidation class, 306
ObjectOutput interface, 306
ObjectOutputStream class, 282, 307
PutField class, 308
ObjectStreamConstants interface, 310
ObjectStreamException, 311
ObjectStreamField class, 311
SealedObject class, 572
Serializable interface, 321
object-oriented programming, 82-135
objects, 61-64
AccessibleObject class, 381
arrays of, converting to collections, 146
collections of, 145
package for, 137
comparing, 73
copying, 71
creating, 62, 88-92
destroying, 92-95
finalizing, 92-95
initializing, 88-92
InvalidObjectException, 301
NullPointerException, 355
Object class, 356
serializing/deserializing, 157
threads and, 151
using, 64
ObjectStreamClass class, 309
Observable class, 527
Observer interface, 528
of() (UnicodeBlock), 335
OID (object identifier), 464
okToUseGui(), 263
on()
DigestInputStream class, 427
DigestOutputStream class, 427
openConnection()
HttpURLConnection class, 402
URL class, 412
URLStreamHandler class, 416
openStream() (URL), 412
operands, 17
list of, 30
number/type, 32
operators, 16, 29-34
arithmetic, 34
list of, 30
special, 42
OptionalDataException, 312
order of evaluation, 33
ordinaryChar(), 323
ordinaryChars(), 323
OutOfMemoryError, 357
output, displaying, 14
output streams, 154-158
BufferedOutputStream class, 280, 283
ByteArrayOutputStream class, 280, 285
CheckedOutputStream class, 551
CipherOutputStream class, 566
DataOutputStream class, 280, 289
DeflaterOutputStream class, 550, 554
FileOutputStream class, 280, 294
FilterOutputStream class, 280, 297
GZIPOutputStream class, 555
JarOutputStream class, 548
ObjectOutputStream class, 282, 307
OutputStream class, 280, 312
OutputStreamWriter class, 312
package for, 136
PipedOutputStream class, 280, 314
StreamCorruptedException, 322
system, 369
ZipOutputStream class, 560
OutputStream class, 154
overriding
methods, 101-104
overrides, 101
vs. shadowing, 102
overview.html file, 199
Owner interface, 455
P
Package class, 357
package.html file, 199
packages, 4, 76-78, 136
access to, 105
capitalization/naming conventions, 189
defining, 76
doc comments for, 199
importing, 77
key, list of, 136
names, unique, 78
not documented in this book, 137
packets of data, 161
padding schemes (cryptography), 572
SunJCE cryptographic provider, supporting, 564
@param doc-comment tag, 195
ParameterDescriptor class, 256
parameters, 12
capitalization/naming conventions, 190
parentheses ()
in expressions, 33
for method parameters, 12
parse(), 493
DateFormat class, 485
MessageFormat class, 491
NumberFormat class, 492
parseByte(), 332
ParseException, 493
parseInt(), 14, 349
parseLong(), 351
parseNumbers(), 323
parseObject(), 493
DateFormat class, 485
Format class, 490
NumberFormat class, 492
ParsePosition class, 493
parseShort(), 363
parsing
input, 13
integers, 14
pass-by-reference languages, 74
pass-by-value languages, 74
PasswordAuthentication class, 406
password-based encryption (PBE), 581
passwords, authenticating, 395
path separators, 200
PBE (password-based encryption), 581
PBEKeySpec class, 581
PBEParameterSpec class, 581
PBEWithMD5AndDES algorithm, 564
peek(), 535
performance, 8
Permission class, 171, 439
Permission interface
java.security.acl Package, 456
PermissionCollection class, 440
permissions, 170
accessing local filesystem, 295
classes/subclasses, 173-177
delayed resolution of, 452
NetPermission class, 405
PropertyPermission class, 529
ReflectPermission class, 389
restricted, 7
serialization features, 322
SocketPermission class, 410
URLClassLoader class, 413
Permissions class, 418, 441
PhantomReference class, 377-378
PipedInputStream class, 157, 280, 313
PipedOutputStream class, 157, 280, 314
PipedReader class, 157, 314
PipedWriter class, 157, 315
PKCS#5 (password-based encryption algorithm), 581
PKCS8EncodedKeySpec interface, 473
platforms, 4
(see also Java platform)
pleaseStop() method, 150
policies, 170
Policy class, 170, 418, 441
policytool program, 170, 172, 235
poll() (ReferenceQueue), 379
pop(), 535
portability
certification program, 192
conventions, 190-192
post-increment operator, 35
precedence, 31
pre-increment operator, 35
prev() (CharacterIterator), 480
previous(), 501
BreakIterator class, 480
ListIterator interface, 522
previousIndex() (ListIterator), 522
primary expressions, 29
primitive data types, 22-29
boolean, 332
char, 333
double, 342
float, 345
int, 349
long, 351
short, 362
Principal interface, 442
print()
PrintStream class, 315
PrintWriter class, 316
println(), 155, 369
PrintStream class, 315
PrintWriter class, 316
printStackTrace(), 374
PrintStream class, 315
PrintWriter class, 282, 316
priority levels, 149
private key encryption, 418, 577
Diffie-Hellman private key, 580
DSA private key, 468
RSA private key, 468
private keys, 162
tool for, 231
PrivateKey interface, 442
DSA, casting to, 468
RSAPrivateCrtKey, casting to, 468
PrivilegedAction interface, 443
PrivilegedActionException, 443
PrivilegedExceptionAction, 443
procedures (see methods)
Process class, 161, 328, 358
processes, 161
programmers
application, security for, 172
beans, using, 179
Java and, 4, 8
system, security for, 171
programming, 7
network-centric, 7
(see also Java programming)
programs
complete, conventions/rules for, 192
defining, 79
running, 79
properties, 110
Properties class, 528
PropertyChangeEvent class, 248, 252, 256
PropertyChangeListener interface, 248, 252, 257
PropertyChangeSupport class, 258
PropertyDescriptor class, 258
PropertyEditor interface, 259
PropertyEditorManager class, 260
PropertyEditorSupport class, 260
PropertyPermission class, 529
PropertyResourceBundle class, 530
PropertyVetoException, 261
Properties class, 146
properties (JavaBeans), 179
constrained, 184-186
conventions for, 182
indexed, 183
conventions for, 183
PropertyChangeEvent class, 266
propertyNames(), 528
PropertyVetoException, 266-267
ProtectionDomain class, 418, 444
ProtocolException, 406
Provider class, 444
ProviderException class, 445
Proxy class, 381, 388
pseudo-random numbers, 142, 418, 446, 530
Cipher class, 564
public key encryption, 162, 418, 577
Diffie-Hellman public key, 581
DSA public key, 468
entities, 429
package for, 137
RSA public key, 469
tool for, 231
public static void declaration, 12
PublicKey interface, 445
RSA, setting to, 466
RSAPublicKey, casting to, 469
push(), 535
pushBack(), 323
PushbackInputStream class, 318
PushbackReader class, 318
put()
AbstractMap class, 500
HashMap class, 516
Hashtable class, 518
Map interface, 525
Properties class, 528
TreeMap class, 539
putAll() (Map), 525
PutField class, 308
putFields() (Object(ObjectOutputStream), 307
putNextEntry()
JarOutputStream class, 549
ZipOutputStream class, 560
Q
quick reference material, generating, xvi
quoteChar(), 323
R
radians, 142
Random class, 142, 497, 530
RandomAccessFile class, 154, 280, 319
RC2ParameterSpec class, 582
RC5ParameterSpec class, 582
read(), 548
CheckedInputStream class, 551
DataInputStream class, 288
DigestInputStream class, 427
FileInputStream class, 293
FilterInputStream class, 280
GZIPInputStream class, 555
InflaterInputStream class, 556
InputStream class, 299
Manifest class, 549
Reader class, 320
Socket class, 407
ZipInputStream class, 559
Reader class, 154
readers
BufferedReader class, 282-283
CharArrayReader class, 286
FileReader class, 296
FilterReader class, 297
InputStreamReader class, 300
LineNumberReader class, 302
PipedReader class, 314
PushbackReader class, 318
Reader class, 282, 320
StringReader class, 324
readExternal(), 290
readFields() (ObjectInputStream), 304-305
readFully() (DataInputStream), 288
readLine()
BufferedReader class, 282-283
DataInputStream class, 288
LineNumberReader class, 302
readObject()
ObjectInputStream class, 304-306, 321
OptionalDataException, 312
Serializable interface, 303
readUnsignedByte() (DataInputStream), 288
readUnsignedShort() (DataInputStream), 288
readUTF() (DataInputStream), 288
ready() (Reader), 320
receive() (DatagramSocket), 399
rectangular arrays, 69
Reference class, 377-378
reference types, 28, 70-76
conversions, 75
ReferenceQueue class, 377, 379
references, 70
null, 74
referent, 377
reflection, 147
package for, 137
ReflectPermission class, 389
refresh() (Policy), 441
registerEditor (PropertyEditorManager), 260
registerValidation() (ObjectInputStream), 304, 306
releaseBeanContextResources() (BeanContextChildSupport), 267
releaseService()
BeanContextServiceProvider interface, 270
BeanContextServices interface, 272
remove()
AbstractList class, 500
AbstractMap class, 500
BCSIterator class, 279
Collection interface, 508
HashSet class, 517
Hashtable class, 518
Iterator class, 497
Iterator interface, 519
LinkedList class, 520
List interface, 521
ListIterator interface, 522
Map interface, 525
ReferenceQueue class, 379
TreeMap class, 539
TreeSet class, 539
removeAll() (Collection), 508
removeElementAt() (Vector), 540
removePropertyChangeListener(), 252, 260
removeShutdownHook(), 359
renameTo() (File), 291
repetitive tasks, threads for, 150
replace() (StringBuffer), 365
requestPasswordAuthentication() (Authenticator), 396, 405
reserved words, 22
reset()
ByteArrayOutputStream class, 285
CertificateFactory class, 460
CharArrayReader class, 286
CharArrayWriter class, 286
Checksum interface, 552
InputStream class, 299
MessageDigest class, 437
Reader class, 320
StringReader class, 324
resetSyntax(), 323
ResourceBundle class, 497, 531
Java programming
books, xiii
language, 19
tutorial, 17
web sites, xiv
JavaBeans API event model, 180
portability certification program (Sun), 192
quick reference material, generating, xvi
RMI tool, 200
security, 172
standard extensions, 137
restrictions
on anonymous classes, 129
on local classes, 125
on member classes, 121
on static member classes, 119
resume() (Thread), 370
retainAll() (Collection), 508
@return doc-comment tag, 195
return statements, 53
return types, 33
return values, 12
returning results, 17
reverse() (Collections), 510
reverseOrder() (Collections), 510
revokeService() (BeanContextServices), 273
right-to-left associativity, 31
roll(), 506
root directories, listing, 291
RSA and DSA public and private keys, 466
representing and encoding, 470-475
RSAKey interface, 468
RSAKeyGenParameterSpec interface, 474
RSAPrivateCrtKey interface, 468
RSAPrivateCrtKeySpec interface, 474
RSAPrivateKey interface, 469
RSAPrivateKeySpec interface, 474
RSAPublicKey interface, 466, 469
RSAPublicKeySpec interface, 475
RuleBasedCollator class, 494
rules, 181
pure Java, 190-192
(see also conventions)
run(), 149
PrivilegedAction interface, 443
PrivilegedExceptionAction, 443
Runnable interface, 358
Thread class, 370
TimerTask class, 537
runFinalization(), 359
System class, 369
Runnable interface, 149, 358
running programs, 10
Runtime class, 328, 359
RuntimeException, 360
RuntimePermission class, 360
S
sameFile(), 412
URL class, 412
"sandbox", 168
save() (Properties), 528
schedule() (Timer), 536
scheduleAtFixedRate() (Timer), 536
scheduledExecutionTime() (TimerTask), 537
scope
vs. inheritance for member classes, 123
of local classes, 126
SDK (Software Development Kit), 6
downloads, 9
tools, 200-236
SealedObject class, 165, 572
searching arrays, 144
SecretKey interface, 163, 573
SecretKeyFactory class, 573
SecretKeyFactorySpi class, 574
SecretKeySpec class, 582
secure hash (see message digests)
SecureClassLoader class, 446
SecureRandom class, 418, 446
SecureRandomSpi class, 447
security, 7, 161-163, 166-177
access control lists (ACLs), working with, 453-456
architecture, 167
certificates, working with, 457-465
default, 172
DSA and RSA public and private key representations, 470-475
GeneralSecurityException, 428
interfaces package, 466-469
java.security Package, 418-452
NetPermission class, 405
packets, sending/receiving, 399
permission to access files, 295
ReflectPermission class, 389
risks, 166
RunTimePermission class, 361
Security class, 448
SecurityException, 361
SecurityManager class, 361
SecurityPermission class, 448
socket permissions, 410
system properties, granting access to, 529
tool for policy configuration files, 235
URLClassLoader class, 413
users, 171-173
SecurityManager class, 168, 170
@see doc-comment tag, 196
seek(), 319
self-reflection, 147
semicolon (;)
in program lines, 10
separating statements, 13
send()
DatagramSocket class, 399
MulticastSocket class, 405
separators, file/path, 200
SequenceInputStream class, 321
sequential data (see streaming data)
@serial doc-comment tag, 198
@serialData doc-comment tag, 198
@serialField doc-comment tag, 198
Serializable interface, 321
SerializablePermission class, 322
serializing objects, 157
serialver program, 236
ServerSocket class, 159, 395, 407
service provider interface, 418
CertificateFactory class, 461
CipherSpi class, 566
javax.crypto Package, 561
KeyAgreementSpi class, 569
KeyGeneratorSpi class, 570
KeyStoreSpi class, 437
MacSpi class, 572
message-digest algorithms, 438
SecretKeyFactorySpi class, 574
secure random number generation, 447
serviceAvailable() (BeanContextServicesListener), 274
serviceRevoked() (BeanContextServiceRevokedListener), 272
services protocol (JavaBeans), 187
set(), 414, 500
Array class, 383
ArrayList class, 502
Calendar class, 506
Field class, 384
LinkedList class, 520
List interface, 521
ListIterator interface, 501, 522
ThreadLocal class, 373
set accessor method, 181
Set interface, 497, 532
AbstractSet class, 502
SortedSet interface, 534
setAccessible() (AccessibleObject), 381, 389
setAllowUserInteraction(), 414
setBeanContext(), 188, 266
setBound() (PropertyDescriptor), 258
setCalendar() (DateFormat), 485
setCertificateEntry() (KeyStore), 435
setCharAt() (StringBuffer), 366
setConstrained() (PropertyDescriptor), 258
setContentHandlerFactory() (ContentHandlerFactor), 398
setContextClassLoader() (Thread) , 370
setDaemon() (Thread), 370
setDatagramSocketImplFactory() (DatagramSocket), 401
setDefault() (Authenticator), 395, 405
setDefaultAllowUserInteraction(), 414
setDefaultUseCaches(), 414
setDesignTime(), 251
setDisplayName(), 253
setDoInput(), 414
setDoOutput(), 414
setElementAt() (Vector), 540
setEndRule() (SimpleTimeZone), 532
setErr() (System), 369
setExpert(), 253
setFollowRedirects(), 402
setFormat() (MessageFormat), 491
setGroupingUsed() (NumberFormat), 491
setGuiAvailable(), 251
setHidden(), 253
setIfModifiedSince(), 414
setIn() (System), 369
setInDefaultEventSet(), 252
setIndex()
CharacterIterator interface, 481
ParsePosition class, 493
setInput()
Deflater class, 553
Inflater class, 556
setKeepAlive() (Socket), 407
setKeyEntry() (KeyStore), 435
setLastModified() (File), 291
setLevel() (ZipOutputStream), 549, 560
setLineNumber() (LineNumberReader), 302
setLocale() (MessageFormat), 491
setMaximumFractionDigits() (NumberFormat), 491
setMaxPriority() (ThreadGroup), 372
setMethod(), 549
ZipOutputStream class, 560
setName()
FeatureDescriptor class, 253
Thread class, 370
setNegativePermissions() (AclEntry), 454
setObject(), 252
setOption() (SocketOptions), 410
setOut() (System), 369
setPolicy() (Policy), 441, 448
setPriority() (Thread), 370
setProperties() (System), 368
setProperty()
Properties class, 528
System interface, 529
setPropertyEditorClass(), 258
setReadOnly() (File), 291
setReceiveBufferSize()
DatagramSocket class, 400
Socket class, 407
setRequestMethod(), 402
sets, 145
setSecurityManager() (System), 369
setSeed(), 530
SecureRandom class, 447
setSendBufferSize()
DatagramSocket class, 400
Socket class, 407
setShortDescription(), 253
setSoTimeout()
DatagramSocket class, 400
Socket class, 407
setStartRule() (SimpleTimeZone), 532
setStrength() (Collator), 484
setTcpNoDelay() (Socket), 407
setText() (BreakIterator), 479
setTimeToLive() (MulticastSocket), 405
setTimeZone() (DateFormat), 485
setTime() (Calendar), 506
setUnicast(), 252
setUseCaches(), 414
setValue()
Entry interface, 526
FeatureDescriptor class, 253
shadowing
fields, 100
vs. overriding, 102
shift operators, 38
Short class, 140, 328, 362
ShortBufferException, 574
shuffle() (Collections), 510
shutdownInput() (Socket), 407
shutdownOutput() (Socket), 407
side effects, 33
sign() (Signature), 449
Signature class, 418, 448
SignatureException, 450
signatures, 60
SignatureSpi class, 450
signed right shift (>>) operator, 40
SignedObject class, 163, 419, 450
Signer class, 451
SimpleBeanInfo class, 250, 261
SimpleDateFormat class, 476, 494
SimpleTimeZone class, 532
@since doc-comment tag, 198
single character (}), 15
single-line comments (//), 20
singleton() (Collections), 510
singletonList() (Collections), 510
singletonMap() (Collections) , 510
size(), 500-501
AbstractCollection class, 497
BeanContextMembershipEvent class, 269
CharArrayWriter class, 286
DataOutputStream class, 289
Map interface, 525
Vector class, 540
skip()
CheckedInputStream class, 551
InflaterInputStream class, 556
InputStream class, 299
Reader class, 320
ZipInputStream class, 559
skipBytes(), 288
slashSlashComments(), 323
slashStarComments(), 323
sleep() (Thread), 370
Socket class, 158
SocketOptions interface, 410
SocketPermission class, 410
sockets
BindException, 397
ConnectException, 398
DatagramSocket class, 395, 399
DatagramSocketImpl class, 400
MulticastSocket class, 395, 405
ServerSocket class, 407
Socket class, 395, 407
SocketException, 409
SocketImpl class, 409
SocketImplFactory interface, 410
unable to connect to remote host, 406
SoftReference class, 377, 379
software components
package for, 136
reusable, 178
Software Development Kit (see SDK)
Solaris operating system, SDK for, 9
SortedMap interface, 497, 533
SortedSet interface, 497, 534
sorting arrays, 144
sort()
Arrays class, 503
Collections class, 509
spaces, 15
spaces in doc comments, 194
special effects, threads for, 150
SPI (see service provider interface)
Stack class, 535
EmptyStackException, 514
StackOverflowError, 363
stacks
LinkedList, well-suited for, 520
standard extensions, 6
conventions/rules for, 192
start () method, 149
startsWith(), 365
start() (Thread), 370
statements, 13, 43-59
break, 52
compound, 44
continue, 53
do, 50
empty, 45
expression, 44
for, 51
if/else, 46
labeled, 45
local variable declaration, 45
return, 53
switch, 48
synchronized, 54
throw, 55
try/catch/finally, 57
types, list of, 43
while, 50
static member classes, 117-118
implementation, 131
static method lookup, 103
stop(), 150
Thread class, 370
store()
KeyStore class, 436
Properties class, 528
StreamCorruptedException, 322
streaming data, 154
(see also input streams; output streams)
StreamTokenizer class, 323
StrictMath class, 364
String class, 138
StringBuffer class, 139, 366
strings, 26, 138-140
concatenation, 367
String class, 328, 365
StringBuffer class, 328
StringBufferInputStream class, 324
StringCharacterIterator class, 495
StringIndexOutOfBoundsException, 368
StringReader class, 324
StringTokenizer class, 497, 535
StringWriter class, 325
StringTokenizer class, 139
StringWriter class, 157
strongly typed languages, 13
subclass constructors, 97
subclasses, 95-104
Permission, 173-177
subList(), (List)
subMap() (SortedMap), 533
subroutines (see methods)
Subset class, 335
subSet() (SortedSet), 534
substraction (-) operator, 34
substring() (StringBuffer), 365
SunJCE cryptographic provider, 561
cryptographic algorithms, supporting, 563
Diffie-Hellman key-agreement algorithm, supporting, 567
key-generation implementations, supporting, 569
message authentication algorithms, supporting, 570
padding schemes, supporting, 564
RC2 encryption algorithm, not supporting, 582
RC5 encryption algorithm, not supporting, 582
SecretKeyFactory implementations, supporting, 573
superclasses, 97
fields, shadowing, 100
methods, overriding, 101-104
suspend() (Thread), 370
Swing programmming, 178
switch statements, 48
symmetric keys, 163
SyncFailedException, 325
synchronized methods (Collections), 510
synchronized statements, 54
synchronizedList() (Collections), 502, 520
synchronizedSet() (Collections), 517, 540
synchronizing threads, 151
IllegalMonitorStateException, 347
system administrators, security for, 172
System class, 144, 328, 368
system programmers, security for, 171
system properties, read and write access control, 529
T
tabs, 15
tailMap() (SortedMap), 533
tailSet() (SortedSet), 534
ternary (three-operand) operators, 41
text
displaying, 155
outputing to file, 155
text editors, 10
text files, reading, 154
Thread class, 149, 370
thread synchronization
IllegalMonitorStateException, 347
ThreadDeath error, 372
ThreadGroup class, 372
ThreadLocal class, 373
threads, 149-152
IllegalThreadStateException, 347
inheritance, 348
InterruptedException, 350
multiple, caution with, 151
safety, 510, 518, 541
synchronizing, 151
terminating, 150
Thread class, 328, 370
ThreadDeath error, 372
ThreadGroup class, 372
waiting, list of, 152
throw statements, 55
Throwable interface, 328, 374
throwing exceptions, 18
@throws doc-comment tag, 196
Timer class, 150, 497, 536
TimerTask class, 150, 497, 537
times, 143
time-to-live (TTL) values, 405
TimeZone class, 497, 537
SimpleTimeZone class, 532
toArray()
BeanContextMembershipEvent class, 269
Collection interface, 508
toBinaryString()
Integer class, 349
Long class, 351
toByteArray() (ByteArrayOutputStream), 285
toCharArray() (CharArrayWriter), 286, 365
toHexString()
Integer class, 349
Long class, 351
tokenizing words, 139
toLowerCase(), 365
toOctalString()
Integer class, 349
Long class, 351
tools, 200-236
TooManyListenersException, 538
toPattern()
ChoiceFormat class, 481
MessageFormat class, 491
toString()
Byte class, 332
ByteArrayOutputStream class, 285
CharArrayWriter class, 286
Integer class, 349
Long class, 351
MessageFormat class, 490
Object class, 356
PrintStream class, 315
Short class, 363
StringBuffer class, 366
StringWriter class, 325
Subset class, 335
totalMemory(), 359
toUpperCase(), 365
traceInstructions(), 359
traceMethodCalls(), 359
TreeMap class, 539
TreeSet class, 539
trim(), 365
trimToSize() (ArrayList), 502
triple-DES key, 578
try clause, 58
try/catch/finally statements, 57
TTL values, 405
type conversions, 27, 43
types, 147
U
Unicode, 20, 190
currency symbols, 21
PrintStream class and, 315
subset, 335
UnicodeBlock class, 335
UTFDataFormatException, 326
unary minus (-), 35
unary (~) operator (see bitwise complement operator)
uncaughtException() (ThreadGroup), 372
UndeclaredThrowableException, 386, 389
undecremented values, 36
underscore (_) in identifier name, 21
unicast events (JavaBeans), 180
uniform resource locator (see URLs)
UnknownError, 374
UnknownHostException, 411
UnknownServiceException, 412
unmodifiable methods (Collection), 510
unread()
PushbackInputStream class, 318
PushbackReader class, 318
UnrecoverableKeyException, 451
unreliable datagram packets, 399
UnresolvedPermission class, 452
UnsatisfiedLinkError, 375
unsigned right shift (>>>) operator, 40
UnsupportedClassVersionError, 375
UnsupportedEncodingException, 325
UnsupportedOperationException, 375, 509-510, 519
until loop, 16
untrusted code, 166-172
update()
Checksum interface, 552
Cipher class, 564
MessageDigest class, 437
Observable class, 527
Observer interface, 528
Signature class, 449
URLs, 158
examples in this book, xv
HttpURLConnection class, 402
InfoBus standard extension, 179
JAR archive URLs, 404
Java Activation Framework standard extension, 179
Java language specification, 19
MalformedURLException, 404
URL class, 158, 160, 395, 412
URLClassLoader class, 413
URLConnection class, 395, 414
URLDecoder class, 416
URLEncoder class, 416
URLStreamHandler class, 416
URLStreamHandlerFactory interface, 417
Java programming, xiv
tutorial, 17
JavaBeans conventions, 179
portability certification program (Sun), 192
quick reference material, generating, xvi
SDK, 9
security, 172
useProtocolVersion() (ObjectOutputStream), 310
user preference files, Properties class and, 146
username and password, encapsulating, 406
users, security and, 171-173
UTF-8 encoding
UTFDataFormatException, 326
UTFDataFormatException, 326
V
validateObject() (ObjectInputValidation), 306
validatePendingAdd()(BeanContextSupport), 277
validatePendingSetBeanContext() (BeanContextChildSupport), 267
validation
InvalidObjectException, 301
ObjectInputValidation class, 306
valueOf()
Boolean class, 332
Byte class, 332
Float class, 345
Integer class, 349
Long class, 351
Short class, 363
String class, 365
values() (Map), 525
variable scope, 15
variables, 13, 29
declaring, 13
IllegalAccessError, 346
local, 45
capitalization/naming conventions, 190
Vector class, 145, 540
VerifyError, 375
verify()
Certificate class, 457
Signature class, 449
SignedObject class, 450
X509Certificate class, 462
X509CRL class, 463
VerifyError, 375
@version doc-comment tag, 195
VetoableChangeListener interface, 256, 262, 266
VetoableChangeSupport class, 262
vetoableChange(), 262
VirtualMachineError, 376
visibility
members, working with, 381
Visibility interface, 263
VM implementations, 4
Void class, 376
W
wait() (Object), 152, 347, 370, 356
waitFor(), 358
weak references, package for, 136
WeakHashMap class, 542
WeakReference class, 377, 380
while loop, 16
while statements, 50
whitespaceChars(), 323
widening conversions, 27
wizards, 181
wordChars(), 323
WordPad, 10
write(), 326, 549
BufferedWriter class, 284
CharArrayWriter class, 286
CheckedOutputStream class, 552
DataOutputStream class, 289
DeflaterOutputStream class, 554
DigestOutputStream class, 427
FileOutputStream classes, 294
FilterOutputStream class, 280
FilterWriter class, 298
GZIPOutputStream class, 555
Manifest class, 549
ObjectOutputStream class, 308
OutputStream class, 312
PrintWriter class, 316
StringWriter class, 325
ZipOutputStream class, 560
"Write once, run anywhere", 6, 190
WriteAbortedException, 326
writeExternal(), 290
writeFields() (ObjectOutputStream), 307
writeObject()
&n