Sitemap Table of Contents Dedication Copyright Preface Changes in the Fifth Edition Contents of This Book Related Books Examples Online Conventions Used in This Book Request for Comments How the Quick Reference Is Generated Acknowledgments Part I: Introducing Java Chapter 1. Introduction Section 1.1. What Is Java? Section 1.2. Key Benefits of Java Section 1.3. An Example Program Chapter 2. Java Syntax from the Ground Up Section 2.1. Java Programs from the Top Down Section 2.2. Lexical Structure Section 2.3. Primitive Data Types Section 2.4. Expressions and Operators Section 2.5. Statements Section 2.6. Methods Section 2.7. Classes and Objects Introduced Section 2.8. Arrays Section 2.9. Reference Types Section 2.10. Packages and the Java Namespace Section 2.11. Java File Structure Section 2.12. Defining and Running Java Programs Section 2.13. Differences Between C and Java Chapter 3. Object-Oriented Programming in Java Section 3.1. Class Definition Syntax Section 3.2. Fields and Methods Section 3.3. Creating and Initializing Objects Section 3.4. Destroying and Finalizing Objects Section 3.5. Subclasses and Inheritance Section 3.6. Data Hiding and Encapsulation Section 3.7. Abstract Classes and Methods Section 3.8. Important Methods of java.lang.Object Section 3.9. Interfaces Section 3.10. Nested Types Section 3.11. Modifier Summary Section 3.12. C++ Features Not Found in Java Chapter 4. Java 5.0 Language Features Section 4.1. Generic Types Section 4.2. Enumerated Types Section 4.3. Annotations Chapter 5. The Java Platform Section 5.1. Java Platform Overview Section 5.2. Text Section 5.3. Numbers and Math Section 5.4. Dates and Times Section 5.5. Arrays Section 5.6. Collections Section 5.7. Threads and Concurrency Section 5.8. Files and Directories Section 5.9. Input/Output with java.io Section 5.10. Networking with java.net Section 5.11. I/O and Networking with java.nio Section 5.12. XML Section 5.13. Types, Reflection, and Dynamic Loading Section 5.14. Object Persistence Section 5.15. Security Section 5.16. Cryptography Section 5.17. Miscellaneous Platform Features Chapter 6. Java Security Section 6.1. Security Risks Section 6.2. Java VM Security and Class File Verification Section 6.3. Authentication and Cryptography Section 6.4. Access Control Section 6.5. Security for Everyone Section 6.6. Permission Classes Chapter 7. Programming and Documentation Conventions Section 7.1. Naming and Capitalization Conventions Section 7.2. Portability Conventions and Pure Java Rules Section 7.3. Java Documentation Comments Section 7.4. JavaBeans Conventions Chapter 8. Java Development Tools apt extcheck jarsigner jar java javac javadoc javah javap javaws jconsole jdb jinfo jmap jps jsadebugd jstack jstat jstatd keytool native2ascii pack200 policytool serialver unpack200 Part II: API Quick Reference Chapter 9. java.io Package java.io BufferedInputStream BufferedOutputStream BufferedReader BufferedWriter ByteArrayInputStream ByteArrayOutputStream CharArrayReader CharArrayWriter CharConversionException Closeable DataInput DataInputStream DataOutput DataOutputStream EOFException Externalizable File FileDescriptor FileFilter FileInputStream FilenameFilter FileNotFoundException FileOutputStream FilePermission FileReader FileWriter FilterInputStream FilterOutputStream FilterReader FilterWriter Flushable InputStream InputStreamReader InterruptedIOException InvalidClassException InvalidObjectException IOException LineNumberInputStream LineNumberReader NotActiveException NotSerializableException ObjectInput ObjectInputStream ObjectInputStream.GetField ObjectInputValidation ObjectOutput ObjectOutputStream ObjectOutputStream.PutField ObjectStreamClass ObjectStreamConstants ObjectStreamException ObjectStreamField OptionalDataException OutputStream OutputStreamWriter PipedInputStream PipedOutputStream PipedReader PipedWriter PrintStream PrintWriter PushbackInputStream PushbackReader RandomAccessFile Reader SequenceInputStream Serializable SerializablePermission StreamCorruptedException StreamTokenizer StringBufferInputStream StringReader StringWriter SyncFailedException UnsupportedEncodingException UTFDataFormatException WriteAbortedException Writer Chapter 10. java.lang and Subpackages Package java.lang AbstractMethodError AbstractStringBuilder Appendable ArithmeticException ArrayIndexOutOfBoundsException ArrayStoreException AssertionError Boolean Byte Character Character.Subset Character.UnicodeBlock CharSequence Class<T> ClassCastException ClassCircularityError ClassFormatError ClassLoader ClassNotFoundException Cloneable CloneNotSupportedException Comparable<T> Compiler Deprecated Double Enum<E extends Enum<E>> EnumConstantNotPresentException Error Exception ExceptionInInitializerError Float IllegalAccessError IllegalAccessException IllegalArgumentException IllegalMonitorStateException IllegalStateException IllegalThreadStateException IncompatibleClassChangeError IndexOutOfBoundsException InheritableThreadLocal<T> InstantiationError InstantiationException Integer InternalError InterruptedException Iterable<T> LinkageError Long Math NegativeArraySizeException NoClassDefFoundError NoSuchFieldError NoSuchFieldException NoSuchMethodError NoSuchMethodException NullPointerException Number NumberFormatException Object OutOfMemoryError Override Package Process ProcessBuilder Readable Runnable Runtime RuntimeException RuntimePermission SecurityException SecurityManager Short StackOverflowError StackTraceElement StrictMath String StringBuffer StringBuilder StringIndexOutOfBoundsException SuppressWarnings System Thread Thread.State Thread.UncaughtExceptionHandler ThreadDeath ThreadGroup ThreadLocal<T> Throwable TypeNotPresentException UnknownError UnsatisfiedLinkError UnsupportedClassVersionError UnsupportedOperationException VerifyError VirtualMachineError Void Package java.lang.annotation Annotation AnnotationFormatError AnnotationTypeMismatchException Documented ElementType IncompleteAnnotationException Inherited Retention RetentionPolicy Target Package java.lang.instrument ClassDefinition ClassFileTransformer IllegalClassFormatException Instrumentation UnmodifiableClassException Package java.lang.management ClassLoadingMXBean CompilationMXBean GarbageCollectorMXBean ManagementFactory ManagementPermission MemoryManagerMXBean MemoryMXBean MemoryNotificationInfo MemoryPoolMXBean MemoryType MemoryUsage OperatingSystemMXBean RuntimeMXBean ThreadInfo ThreadMXBean Package java.lang.ref PhantomReference<T> Reference<T> ReferenceQueue<T> SoftReference<T> WeakReference<T> Package java.lang.reflect AccessibleObject AnnotatedElement Array Constructor<T> Field GenericArrayType GenericDeclaration GenericSignatureFormatError InvocationHandler InvocationTargetException MalformedParameterizedTypeException MalformedParameterizedTypeException Member Method Modifier ParameterizedType ParameterizedType Proxy ReflectPermission Type TypeVariable<D extends GenericDeclaration> UndeclaredThrowableException WildcardType Chapter 11. java.math Package java.math BigDecimal BigInteger MathContext RoundingMode Chapter 12. java.net Package java.net Authenticator Authenticator.RequestorType BindException CacheRequest CacheResponse ConnectException ContentHandler ContentHandlerFactory CookieHandler DatagramPacket DatagramSocket DatagramSocketImpl DatagramSocketImplFactory FileNameMap HttpRetryException HttpURLConnection Inet4Address Inet6Address InetAddress InetSocketAddress JarURLConnection MalformedURLException MulticastSocket NetPermission NetworkInterface NoRouteToHostException PasswordAuthentication PortUnreachableException ProtocolException Proxy Proxy.Type ProxySelector ResponseCache SecureCacheResponse ServerSocket Socket SocketAddress SocketException SocketImpl SocketImplFactory SocketOptions SocketPermission SocketTimeoutException UnknownHostException UnknownServiceException URI URISyntaxException URL URLClassLoader URLConnection URLDecoder URLEncoder Chapter 13. java.nio and Subpackages Package java.nio Buffer BufferOverflowException BufferUnderflowException ByteBuffer ByteOrder CharBuffer DoubleBuffer FloatBuffer IntBuffer InvalidMarkException LongBuffer MappedByteBuffer ReadOnlyBufferException ShortBuffer Package java.nio.channels AlreadyConnectedException AsynchronousCloseException ByteChannel CancelledKeyException Channel Channels ClosedByInterruptException ClosedChannelException ClosedSelectorException ConnectionPendingException DatagramChannel FileChannel FileChannel.MapMode FileLock FileLockInterruptionException GatheringByteChannel IllegalBlockingModeException IllegalSelectorException InterruptibleChannel NoConnectionPendingException NonReadableChannelException NonWritableChannelException NotYetBoundException NotYetConnectedException OverlappingFileLockException Pipe Pipe.SinkChannel Pipe.SourceChannel ReadableByteChannel ScatteringByteChannel SelectableChannel SelectionKey Selector ServerSocketChannel SocketChannel UnresolvedAddressException UnsupportedAddressTypeException WritableByteChannel Package java.nio.channels.spi AbstractInterruptibleChannel AbstractSelectableChannel AbstractSelectionKey AbstractSelector SelectorProvider Package java.nio.charset CharacterCodingException Charset CharsetDecoder CharsetEncoder CoderMalfunctionError CoderResult CodingErrorAction IllegalCharsetNameException MalformedInputException UnmappableCharacterException UnsupportedCharsetException Package java.nio.charset.spi CharsetProvider Chapter 14. java.security and Subpackages Package java.security AccessControlContext AccessControlException AccessController AlgorithmParameterGenerator AlgorithmParameterGenerator AlgorithmParameterGeneratorSpi AlgorithmParameterGeneratorSpi AlgorithmParameters AlgorithmParameters AlgorithmParametersSpi AlgorithmParametersSpi AllPermission AuthProvider BasicPermission Certificate CodeSigner CodeSource DigestException DigestInputStream DigestOutputStream DomainCombiner GeneralSecurityException Guard GuardedObject Identity IdentityScope InvalidAlgorithmParameterException InvalidAlgorithmParameterException InvalidKeyException InvalidParameterException InvalidParameterException Key KeyException KeyFactory KeyFactorySpi KeyManagementException KeyPair KeyPairGenerator KeyPairGeneratorSpi KeyRep KeyRep.Type KeyStore KeyStore.Builder KeyStore.CallbackHandlerProtection KeyStore.Entry KeyStore.LoadStoreParameter KeyStore.LoadStoreParameter KeyStore.PasswordProtection KeyStore.PrivateKeyEntry KeyStore.ProtectionParameter KeyStore.ProtectionParameter KeyStore.SecretKeyEntry KeyStore.TrustedCertificateEntry KeyStoreException KeyStoreSpi MessageDigest MessageDigestSpi NoSuchAlgorithmException NoSuchProviderException Permission PermissionCollection Permissions Policy Principal PrivateKey PrivilegedAction<T> PrivilegedActionException PrivilegedExceptionAction<T> ProtectionDomain Provider Provider.Service ProviderException PublicKey SecureClassLoader SecureRandom SecureRandomSpi Security SecurityPermission Signature SignatureException SignatureSpi SignedObject Signer Timestamp UnrecoverableEntryException UnrecoverableKeyException UnresolvedPermission Package java.security.cert Certificate Certificate.CertificateRep CertificateEncodingException CertificateException CertificateExpiredException CertificateFactory CertificateFactorySpi CertificateNotYetValidException CertificateParsingException CertPath CertPath.CertPathRep CertPathBuilder CertPathBuilderException CertPathBuilderResult CertPathBuilderSpi CertPathParameters CertPathParameters CertPathValidator CertPathValidatorException CertPathValidatorResult CertPathValidatorSpi CertSelector CertStore CertStoreException CertStoreParameters CertStoreParameters CertStoreSpi CollectionCertStoreParameters CollectionCertStoreParameters CRL CRLException CRLSelector LDAPCertStoreParameters LDAPCertStoreParameters PKIXBuilderParameters PKIXBuilderParameters PKIXCertPathBuilderResult PKIXCertPathChecker PKIXCertPathValidatorResult PKIXParameters PKIXParameters PolicyNode PolicyQualifierInfo TrustAnchor X509Certificate X509CertSelector X509CRL X509CRLEntry X509CRLSelector X509Extension Package java.security.interfaces DSAKey DSAKeyPairGenerator DSAParams DSAParams DSAPrivateKey DSAPublicKey ECKey ECPrivateKey ECPublicKey RSAKey RSAMultiPrimePrivateCrtKey RSAPrivateCrtKey RSAPrivateKey RSAPublicKey Package java.security.spec AlgorithmParameterSpec AlgorithmParameterSpec DSAParameterSpec DSAParameterSpec DSAPrivateKeySpec DSAPublicKeySpec ECField ECFieldF2m ECFieldFp ECGenParameterSpec ECGenParameterSpec ECParameterSpec ECParameterSpec ECPoint ECPrivateKeySpec ECPublicKeySpec EllipticCurve EncodedKeySpec InvalidKeySpecException InvalidParameterSpecException InvalidParameterSpecException KeySpec MGF1ParameterSpec MGF1ParameterSpec PKCS8EncodedKeySpec PSSParameterSpec PSSParameterSpec RSAKeyGenParameterSpec RSAKeyGenParameterSpec RSAMultiPrimePrivateCrtKeySpec RSAOtherPrimeInfo RSAPrivateCrtKeySpec RSAPrivateKeySpec RSAPublicKeySpec X509EncodedKeySpec Chapter 15. java.text Package java.text Annotation AttributedCharacterIterator AttributedCharacterIterator.Attribute AttributedString Bidi BreakIterator CharacterIterator ChoiceFormat CollationElementIterator CollationKey Collator DateFormat DateFormat.Field DateFormatSymbols DecimalFormat DecimalFormatSymbols FieldPosition Format Format.Field MessageFormat MessageFormat.Field NumberFormat NumberFormat.Field ParseException ParsePosition RuleBasedCollator SimpleDateFormat StringCharacterIterator Chapter 16. java.util and Subpackages Package java.util AbstractCollection<E> AbstractList<E> AbstractMap<K,V> AbstractQueue<E> AbstractSequentialList<E> AbstractSet<E> ArrayList<E> Arrays BitSet Calendar Collection<E> Collections Comparator<T> ConcurrentModificationException Currency Date Dictionary<K,V> DuplicateFormatFlagsException EmptyStackException Enumeration<E> EnumMap<K extends Enum<K>,V> EnumSet<E extends Enum<E>> EventListener EventListenerProxy EventObject FormatFlagsConversionMismatchException Formattable FormattableFlags Formatter Formatter.BigDecimalLayoutForm FormatterClosedException GregorianCalendar HashMap<K,V> HashSet<E> Hashtable<K,V> IdentityHashMap<K,V> IllegalFormatCodePointException IllegalFormatConversionException IllegalFormatException IllegalFormatFlagsException IllegalFormatPrecisionException IllegalFormatWidthException InputMismatchException InvalidPropertiesFormatException Iterator<E> LinkedHashMap<K,V> LinkedHashSet<E> LinkedList<E> List<E> ListIterator<E> ListResourceBundle Locale Map<K,V> Map.Entry<K,V> MissingFormatArgumentException MissingFormatWidthException MissingResourceException NoSuchElementException Observable Observer PriorityQueue<E> Properties PropertyPermission PropertyResourceBundle Queue<E> Random RandomAccess ResourceBundle Scanner Set<E> SimpleTimeZone SortedMap<K,V> SortedSet<E> Stack<E> StringTokenizer Timer TimerTask TimeZone TooManyListenersException TreeMap<K,V> TreeSet<E> UnknownFormatConversionException UnknownFormatFlagsException UUID Vector<E> WeakHashMap<K,V> Package java.util.concurrent AbstractExecutorService ArrayBlockingQueue<E> BlockingQueue<E> BrokenBarrierException Callable<V> CancellationException CompletionService<V> ConcurrentHashMap<K,V> ConcurrentLinkedQueue<E> ConcurrentMap<K,V> CopyOnWriteArrayList<E> CopyOnWriteArraySet<E> CountDownLatch CyclicBarrier Delayed DelayQueue<E extends Delayed> Exchanger<V> ExecutionException Executor ExecutorCompletionService<V> Executors ExecutorService Future<V> FutureTask<V> LinkedBlockingQueue<E> PriorityBlockingQueue<E> RejectedExecutionException RejectedExecutionHandler ScheduledExecutorService ScheduledFuture<V> ScheduledThreadPoolExecutor Semaphore SynchronousQueue<E> ThreadFactory ThreadPoolExecutor ThreadPoolExecutor.AbortPolicy ThreadPoolExecutor.CallerRunsPolicy ThreadPoolExecutor.DiscardOldestPolicy ThreadPoolExecutor.DiscardPolicy TimeoutException TimeUnit Package java.util.concurrent.atomic AtomicBoolean AtomicInteger AtomicIntegerArray AtomicIntegerFieldUpdater<T> AtomicLong AtomicLongArray AtomicLongFieldUpdater<T> AtomicMarkableReference<V> AtomicReference<V> AtomicReferenceArray<E> AtomicReferenceFieldUpdater<T,V> AtomicStampedReference<V> Package java.util.concurrent.locks AbstractQueuedSynchronizer AbstractQueuedSynchronizer.ConditionObject Condition Lock LockSupport ReadWriteLock ReentrantLock ReentrantReadWriteLock ReentrantReadWriteLock.ReadLock ReentrantReadWriteLock.WriteLock Package java.util.jar Attributes Attributes.Name JarEntry JarException JarFile JarInputStream JarOutputStream Manifest Pack200 Pack200.Packer Pack200.Unpacker Package java.util.logging ConsoleHandler ErrorManager FileHandler Filter Formatter Handler Level Logger LoggingMXBean LoggingPermission LogManager LogRecord MemoryHandler SimpleFormatter SocketHandler StreamHandler XMLFormatter Package java.util.prefs AbstractPreferences BackingStoreException InvalidPreferencesFormatException NodeChangeEvent NodeChangeListener PreferenceChangeEvent PreferenceChangeListener Preferences PreferencesFactory Package java.util.regex Matcher MatchResult Pattern PatternSyntaxException Package java.util.zip Adler32 CheckedInputStream CheckedOutputStream Checksum CRC32 DataFormatException Deflater DeflaterOutputStream GZIPInputStream GZIPOutputStream Inflater InflaterInputStream ZipEntry ZipException ZipFile ZipInputStream ZipOutputStream Chapter 17. javax.crypto and Subpackages Package javax.crypto BadPaddingException Cipher CipherInputStream CipherOutputStream CipherSpi EncryptedPrivateKeyInfo ExemptionMechanism ExemptionMechanismException ExemptionMechanismSpi IllegalBlockSizeException KeyAgreement KeyAgreementSpi KeyGenerator KeyGeneratorSpi Mac MacSpi NoSuchPaddingException NullCipher SealedObject SecretKey SecretKeyFactory SecretKeyFactorySpi ShortBufferException Package javax.crypto.interfaces DHKey DHPrivateKey DHPublicKey PBEKey Package javax.crypto.spec DESedeKeySpec DESKeySpec DHGenParameterSpec DHGenParameterSpec DHParameterSpec DHParameterSpec DHPrivateKeySpec DHPublicKeySpec IvParameterSpec IvParameterSpec OAEPParameterSpec OAEPParameterSpec PBEKeySpec PBEParameterSpec PBEParameterSpec PSource PSource.PSpecified RC2ParameterSpec RC2ParameterSpec RC5ParameterSpec RC5ParameterSpec SecretKeySpec Chapter 18. javax.net and javax.net.ssl Package javax.net ServerSocketFactory SocketFactory Package javax.net.ssl CertPathTrustManagerParameters CertPathTrustManagerParameters HandshakeCompletedEvent HandshakeCompletedListener HostnameVerifier HttpsURLConnection KeyManager KeyManagerFactory KeyManagerFactorySpi KeyStoreBuilderParameters KeyStoreBuilderParameters ManagerFactoryParameters ManagerFactoryParameters SSLContext SSLContextSpi SSLEngine SSLEngineResult SSLEngineResult.HandshakeStatus SSLEngineResult.Status SSLException SSLHandshakeException SSLKeyException SSLPeerUnverifiedException SSLPermission SSLProtocolException SSLServerSocket SSLServerSocketFactory SSLSession SSLSessionBindingEvent SSLSessionBindingListener SSLSessionContext SSLSocket SSLSocketFactory TrustManager TrustManagerFactory TrustManagerFactorySpi X509ExtendedKeyManager X509KeyManager X509TrustManager Chapter 19. javax.security.auth and Subpackages Package javax.security.auth AuthPermission Destroyable DestroyFailedException Policy PrivateCredentialPermission Refreshable RefreshFailedException Subject SubjectDomainCombiner Package javax.security.auth.callback Callback CallbackHandler ChoiceCallback ConfirmationCallback LanguageCallback NameCallback PasswordCallback TextInputCallback TextOutputCallback UnsupportedCallbackException Package javax.security.auth.kerberos DelegationPermission KerberosKey KerberosPrincipal KerberosTicket ServicePermission Package javax.security.auth.login AccountException AccountExpiredException AccountLockedException AccountNotFoundException AppConfigurationEntry AppConfigurationEntry.LoginModuleControlFlag Configuration CredentialException CredentialExpiredException CredentialNotFoundException FailedLoginException LoginContext LoginException Package javax.security.auth.spi LoginModule Package javax.security.auth.x500 X500Principal X500PrivateCredential Chapter 20. javax.xml and Subpackages Package javax.xml XMLConstants Package javax.xml.datatype DatatypeConfigurationException DatatypeConstants DatatypeConstants.Field DatatypeFactory Duration XMLGregorianCalendar Package javax.xml.namespace NamespaceContext QName Package javax.xml.parsers DocumentBuilder DocumentBuilderFactory FactoryConfigurationError ParserConfigurationException SAXParser SAXParserFactory Package javax.xml.transform ErrorListener OutputKeys Result Source SourceLocator Templates Transformer TransformerConfigurationException TransformerException TransformerFactory TransformerFactoryConfigurationError URIResolver Package javax.xml.transform.dom DOMLocator DOMResult DOMSource Package javax.xml.transform.sax SAXResult SAXSource SAXTransformerFactory TemplatesHandler TransformerHandler Package javax.xml.transform.stream StreamResult StreamSource Package javax.xml.validation Schema SchemaFactory SchemaFactoryLoader TypeInfoProvider Validator ValidatorHandler Package javax.xml.xpath XPath XPathConstants XPathException XPathExpression XPathExpressionException XPathFactory XPathFactoryConfigurationException XPathFunction XPathFunctionException XPathFunctionResolver XPathVariableResolver Chapter 21. org.w3c.dom Package org.w3c.dom Attr CDATASection CharacterData Comment Document DocumentFragment DocumentType DOMConfiguration DOMError DOMErrorHandler DOMException DOMImplementation DOMImplementationList DOMImplementationSource DOMLocator DOMStringList Element Entity EntityReference NamedNodeMap NameList Node NodeList Notation ProcessingInstruction Text TypeInfo UserDataHandler Chapter 22. org.xml.sax and Subpackages Package org.xml.sax AttributeList Attributes ContentHandler DocumentHandler DTDHandler EntityResolver ErrorHandler HandlerBase InputSource Locator Parser SAXException SAXNotRecognizedException SAXNotSupportedException SAXParseException XMLFilter XMLReader Package org.xml.sax.ext Attributes2 Attributes2Impl DeclHandler DefaultHandler2 EntityResolver2 LexicalHandler Locator2 Locator2Impl Package org.xml.sax.helpers AttributeListImpl AttributesImpl DefaultHandler LocatorImpl NamespaceSupport ParserAdapter ParserFactory XMLFilterImpl XMLReaderAdapter XMLReaderFactory Chapter 23. Class, Method, and Field Index Section 23.1. A Section 23.2. B Section 23.3. C Section 23.4. D Section 23.5. E Section 23.6. F Section 23.7. G Section 23.8. H Section 23.9. I Section 23.10. J Section 23.11. K Section 23.12. L Section 23.13. M Section 23.14. N Section 23.15. O Section 23.16. P Section 23.17. Q Section 23.18. R Section 23.19. S Section 23.20. T Section 23.21. U Section 23.22. V Section 23.23. W Section 23.24. X Section 23.25. Y Section 23.26. Z Colophon |