The abstract keyword is used to declare abstract methods and classes. An abstract method has no implementation defined; it is declared with arguments and a return type as usual, but the body enclosed in curly braces is replaced with a semicolon. The implementation of an abstract method is provided by a subclass of the class in which it is defined. If an abstract method appears in a class, the class is also abstract.
An API consists of the functions and variables programmers use in their applications. The Java API consists of all public and protected methods of all public classes in the java.applet, java.awt, java.awt.image, java.awt.peer, java.io, java.lang, java.net, and java.util packages.
An embedded Java application that runs in the context of an applet viewer, such as a web browser.
An HTML tag that specifies an applet run within a web document.
Sun's application that implements the additional structure needed to run and display Java applets.
A Java program that runs standalone; i.e., it doesn't require an applet viewer.
A language feature used to test for conditions that should be guaranteed by program logic. If a condition checked by an assertion is found to be false, a fatal error is thrown. For added performance, assertions can be disabled when an application is deployed.
Java's platform-independent windowing, graphics, and user interface toolkit.
The mystical, spectral, alter-ego of a Snark. From the Lewis Carroll poem "The Hunting of the Snark," 1876.
A primitive Java data type that contains a truth value. The two possible values of a boolean variable are true and false.
A primitive Java data type that's an eight-bit two's-complement signed number (in all implementations).
A behavior that is defined by one object and then later invoked by another object when a particular event occurs.
A technique that explicitly converts one data type to another.
The catch statement introduces an exception-handling block of code following a try statement. The catch keyword is followed by an exception type and argument name in parentheses and a block of code within curly braces.
An electronic document used to verify the identity of a person, group, or organization. Certificates attest to the identity of a person or group and contain that organization's public key. A certificate is signed by a certificate authority.
An organization that is entrusted to issue certificates, taking whatever steps are necessary to verify the identity for which it is issuing the certificate.
A primitive Java data type; a variable of type char holds a single 16-bit Unicode character.
Classes in the core java.util package for working with and sorting structured collections or maps of items. This API includes the Vector and Hashtable classes as well as newer items such as List and Map.
a) An encapsulated collection of data and methods to operate on the data. A class may be instantiated to produce an object that's an instance of the class.
b) The class keyword is used to declare a class, thereby defining a new object type. Its syntax is similar to the struct keyword in C.
An object in the Java security model that is responsible for loading Java binary classes from the network into the local interpreter. A class loader keeps its classes in a separate namespace, so that loaded classes cannot interact with system classes and breach system security.
A method declared static. Methods of this type are not passed implicit this references and may refer only to class variables and invoke other class methods of the current class. A class method may be invoked through the class name, rather than through an instance of the class.
The directory path specifying the location of compiled Java class files on the local system.
A variable declared static. Variables of this type are associated with the class, rather than with a particular instance of the class. There is only one copy of a static variable, regardless of the number of instances of the class that are created.
The application that initiates a conversation as part of a networked client/server application. See also server.
The source code for a Java class. A compilation unit normally contains a single class definition and, in most current development environments, is simply a file with a .java extension.
A program that translates source code into executable code.
A methodology for building parts of an application. It is a way to build reusable objects that can be easily assembled to form applications.
Using objects as part of another, more complex object. When you compose a new object, you create complex behavior by delegating tasks to the internal objects. Composition is different from inheritance, which defines a new object by changing or refining the behavior of an old object. See also inheritance.
A method that is invoked automatically when a new instance of a class is created. Constructors are used to initialize the variables of the newly created object. The constructor method has the same name as the class.
A class that is called to parse a particular type of data and that converts it to an appropriate object.
A packet of data sent to a receiving computer without warning, error checking, or other control information.
A duplicate of an object along with all of the objects that it references, transitively. A deep copy duplicates the entire "graph" of objects, instead of just duplicating references. See also shallow copy.
An in-memory representation of a fully parsed XML document using objects with names like Element, Attribute, and Text. The Java XML DOM API binding is standardized by the World Wide Web Consortium (W3C).
A Java primitive data type; a double value is a 64-bit (double-precision) floating-point number.
A document containing specialized language that expresses constraints on the structure of XML tags and tag attributes. DTDs are used to validate an XML document and can constrain the order and nesting of tags as well as the allowed values of attributes.
An object-oriented programming technique that makes an object's data private or protected (i.e., hidden) and allows programmers to access and manipulate that data only through method calls. Done well, encapsulation reduces bugs and promotes reusability and modularity of classes. This technique is also known as data hiding.
A user's action, such as a mouse-click or key press.
A signal that some unexpected condition has occurred in the program. In Java, exceptions are objects that are subclasses of Exception or Error (which themselves are subclasses of Throwable). Exceptions in Java are "raised" with the throw keyword and received with the catch keyword. See also catch, throw, and throws.
The design pattern of catching an exception and throwing a new, higher level, or more appropriate exception which contains the underlying exception as its cause. The "cause" exception can be retrieved if necessary.
A keyword used in a class declaration to specify the superclass of the class being defined. The class being defined has access to all the public and protected variables and methods of the superclass (or, if the class being defined is in the same package, it has access to all non-private variables and methods). If a class definition omits the extends clause, its superclass is taken to be java.lang.Object.
A keyword modifier that may be applied to classes, methods, and variables. It has a similar, but not identical, meaning in each case. When final is applied to a class, it means that the class may never be subclassed. java.lang.System is an example of a final class. When final is applied to a variable, the variable is a constant; i.e., it can't be modified.
A reserved method name. The finalize() method is called when an object is no longer being used (i.e., when there are no further references to it) but before the object's memory is actually reclaimed by the system. A finalizer should perform cleanup tasks and free system resources not handled by Java's garbage-collection system.
A keyword that introduces the finally block of a try/catch/finally construct. catch and finally blocks provide exception handling and routine cleanup for code in a try block. The finally block is optional and appears after the try block, and after zero or more catch blocks. The code in a finally block is executed once, regardless of how the code in the try block executes. In normal execution, control reaches the end of the try block and proceeds to the finally block, which generally performs any necessary cleanup.
A Java primitive data type; a float value is a 32-bit (single-precision) floating-point number represented in IEEE 754 format.
The process of reclaiming the memory of objects no longer in use. An object is no longer in use when there are no references to it from other objects in the system and no references in any local variables on the method call stack.
A drawable surface represented by the java.awt.Graphics class. A graphics context contains contextual information about the drawing area and provides methods for performing drawing operations in it.
A GUI is constructed from graphical push buttons, text fields, pull-down menus, dialog boxes, and other standard interface components.
An arbitrary-looking identifying number used as a kind of signature for an object. A hashcode stores an object in a hashtable. See also hashtable.
An object that is like a dictionary or an associative array. A hashtable stores and retrieves elements using key values called hashcodes. See also hashcode.
The name given to an individual computer attached to the Internet.
A web browser written in Java, capable of downloading and running Java applets.
The protocol used by web browsers or other clients to talk to web servers. The simplest form of the protocol uses the commands GET to request a file and POST to send data.
A keyword used in class declarations to indicate that the class implements the named interface or interfaces. The implements clause is optional in class declarations; if it appears, it must follow the extends clause (if any). If an implements clause appears in the declaration of a non-abstract class, every method from each specified interface must be implemented by the class or by one of its superclasses.
The import statement makes Java classes available to the current class under an abbreviated name. (Java classes are always available by their fully qualified name, assuming the appropriate class file can be found relative to the CLASSPATH environment variable and that the class file is readable. import doesn't make the class available; it just saves typing and makes your code more legible.) Any number of import statements may appear in a Java program. They must appear, however, after the optional package statement at the top of the file, and before the first class or interface definition in the file.
An important feature of object-oriented programming that involves defining a new object by changing or refining the behavior of an existing object. That is, an object implicitly contains all the non-private variables of its superclass and can invoke all the non-private methods of its superclass. Java supports single inheritance of classes and multiple inheritance of interfaces.
A class definition that is nested within another class. An inner class functions within the lexical scope of another class.
An object. When a class is instantiated to produce an object, we say the object is an instance of the class.
A non-static method of a class. Such a method is passed an implicit this reference to the object that invoked it. See also class method and static.
A Java operator that returns true if the object on its left side is an instance of the class (or implements the interface) specified on its right side. instanceof returns false if the object isn't an instance of the specified class or doesn't implement the specified interface. It also returns false if the specified object is null.
A non-static variable of a class. Copies of such variables occur in every instance of the created class. See also class variable and static.
A primitive Java data type that's a 32-bit two's-complement signed number (in all implementations).
A keyword used to declare an interface. More generally, an interface defines a list of methods that enables a class to implement the interface itself.
The process of making an application accessible to people who speak a variety of languages. Sometimes abbreviated I18N.
The module that decodes and executes Java bytecode.
The process by which a JavaBean provides additional information about itself, supplementing information learned by reflection.
An eight-bit character encoding standardized by the ISO. This encoding is also known as Latin-1 and contains characters from the Latin alphabet suitable for English and most languages of western Europe.
A four-byte character encoding that includes all the world's national standard character encodings. Also known as UCS. The two-byte Unicode character set maps to the range 0x00000000 to 0x0000FFFF of ISO 10646.
A component architecture for Java. It is a way to build interoperable Java objects that can be manipulated easily in a visual application builder environment.
Individual JavaBeans are Java classes that are built using certain design patterns and naming conventions.
A language developed by Netscape for creating dynamic web pages. From a programmer's point of view, it's unrelated to Java, although some of its capabilities are similar. Internally, there may be a relationship, but even that is unclear.
A Java API that allows for generation of Java classes from XML DTD or Schema descriptions and the generation of XML from Java classes. JAXB includes a binding schema that maps names and structures in the Java classes to XML tags and vice versa.
The Java API that allows for pluggable implementations of XML and XSL engines. This API provides an implementation-neutral way to construct parsers and transforms.
The standard Java API for talking to an SQL (structural query language) database.
A native Java DOM created by Jason Hunter and Brett McLaughlin. JDOM is easier to use than the standard DOM API for Java. It uses the Java collections API and standard conventions. Available at http://www.jdom.org/.
An object that controls the arrangement of components within the display area of a container.
A nickname for ISO 8859-1.
A Java component that has no native peer in the AWT.
A variable that is declared inside a single method. A local variable can be seen only by code within that method.
The Java API for structured logging and reporting of messages from within application components. The Logging API supports logging levels indicating the importance of messages, as well as filtering and output capabilities.
A primitive Java data type that's a 64-bit two's-complement signed number (in all implementations).
A long number computed from a message, used to determine whether the message's contents have been changed in any way. A change to a message's contents will change its message digest. It is almost impossible to create two similar messages with the same digest.
The object-oriented programming term for a function or procedure.
Providing definitions of more than one method with the same name but with different argument lists or return values. When an overloaded method is called, the compiler determines which one is intended by examining the supplied argument types.
Defining a method that exactly matches (i.e., same name, same argument types, and same return type) a method defined in a superclass. When an overridden method is invoked, the interpreter uses "dynamic method lookup" to determine which method definition is applicable to the current object.
A user-interface design that originated in Smalltalk. In MVC, the data for a display item is called the "model." A "view" displays a particular representation of the model, and a "controller" provides user interaction with both. Java incorporates many MVC concepts.
A keyword placed before a class, variable, or method that alters the item's accessibility, behavior, or semantics. See also abstract, final, native, private, protected, public, static, and synchronized.
This is a special value of the double and float data types that represents an undefined result of a mathematical operation, such as zero divided by zero.
A modifier that may be applied to method declarations. It indicates that the method is implemented (elsewhere) in C, or in some other platform-dependent fashion. A native method declaration should end with a semicolon instead of a brace-enclosed code block. A native method cannot be abstract, but all other method modifiers may be used with native methods.
A method that is implemented in a native language on a host platform, rather than being implemented in Java. Native methods provide access to such resources as the network, the windowing system, and the host filesystem.
new is a unary operator that creates a new object or array (or raises an OutOfMemoryException if there is not enough memory available).
The Java "new" I/O package. A core package introduced in Java 1.4 to support asynchronous, interruptible, and scalable I/O operations. The NIO API supports nonthread-bound "select" style I/O handling.
null is a special value that indicates a variable doesn't refer to any object. The value null may be assigned to any class or interface variable. It cannot be cast to any integral type, and should not be considered equal to zero, as in C.
An instance of a class. A class models a group of things; an object models a particular member of that group.
A proposed HTML tag that may replace the widely used but nonstandard <APPLET> tag.
The package statement specifies which package the code in the file is part of. Java code that is part of a particular package has access to all classes (public and non-public) in the package, and all non-private methods and fields in all those classes. When Java code is part of a named package, the compiled class file must be placed at the appropriate position in the CLASSPATH directory hierarchy before it can be accessed by the Java interpreter or other utilities. If the package statement is omitted from a file, the code in that file is part of an unnamed default package. This is convenient for small test programs, or during development because it means the code can be interpreted from the current directory.
An HTML tag used within <APPLET> ... </APPLET> to specify a named parameter and string value to an applet within a web page.
A modular application component for a web browser designed to extend the browser's capabilities to handle a specific type of data (MIME type). The Java Plug-in supports Java applets in browsers that do not have up-to-date Java runtime support.
The Java API for storing small amounts of information on a per-user or systemwide basis across executions of the Java VM. The Preferences API is analogous to a small database or the Windows registry.
One of the Java data types: boolean, char, byte, short, int, long, float, double. Primitive types are manipulated, assigned, and passed to methods "by value" (i.e., the actual bytes of the data are copied). See also reference type.
The private keyword is a visibility modifier that can be applied to method and field variables of classes. A private field is not visible outside its class definition.
A keyword that is a visibility modifier; it can be applied to method and field variables of classes. A protected field is visible only within its class, within subclasses, or within the package of which its class is a part. Note that subclasses in different packages can access only protected fields within themselves or within other objects that are subclasses; they cannot access protected fields within instances of the superclass.
Software that describes and enables the use of a new protocol. A protocol handler consists of two classes: a StreamHandler and a URLConnection.
A keyword that is a visibility modifier; it can be applied to classes and interfaces and to the method and field variables of classes and interfaces. A public class or interface is visible everywhere. A non-public class or interface is visible only within its package. A public method or variable is visible everywhere its class is visible. When none of the private, protected, or public modifiers are specified, a field is visible only within the package of which its class is a part.
A cryptographic system that requires a public key and a private key. The private key can decrypt messages encrypted with the corresponding public key, and vice versa. The public key can be made available to the public without compromising cryptographic security.
Any object or array. Reference types are manipulated, assigned, and passed to methods "by reference." In other words, the underlying value is not copied; only a reference to it is. See also primitive type.
The ability of a programming language to interact with structures of the language itself. Reflection in Java allows a Java program to examine class files at runtime to find out about their methods and variables, and to invoke methods or modify variables dynamically.
A compact yet powerful syntax for describing a pattern in text. Regular expressions can be used to recognize and parse most kinds of textual constructs allowing for wide variation in their form.
The core java.util.regex package for using regular expressions. The regex package can be used to search and replace text based on sophisticated patterns.
RMI is a native Java distributed object system. With RMI, you can pass references to objects on remote hosts and invoke methods in them as if they were local objects.
The base of a hierarchy, such as a root class, whose descendants are subclasses. The java.lang.Object class serves as the root of the Java class hierarchy.
SAX is an event-driven API for parsing XML documents in which the client receives events in response to activities such as the opening of tags, character data, and the closing of tags.
XML Schema are a replacement for DTDs. Schema are an XML-based language for expressing constraints on the structure of XML tags and tag attributes, as well as the structure and type of the data content.
A package of software distributed by Sun Microsystems for Java developers. It includes the Java interpreter, Java classes, and Java development tools: compiler, debugger, disassembler, applet viewer, stub file generator, and documentation generator.
The Java class that defines the methods the system calls to check whether a certain operation is permitted in the current environment.
To serialize means to put in order or make sequential. A serialized object is an object that has been packaged so that it can be stored or transmitted over the network. Serialized methods are methods that have been synchronized so that only one may be executing at a given time.
The application that accepts a request for a conversation as part of a networked client/server application. See also client.
A Java application component that implements the javax.servlet.Servlet extension API allowing it to run inside a servlet container or web server. Servlets are widely used in web applications to process user data and generate HTML or other forms of output.
In the Servlet API, the web application environment of a servlet that provides server and application resources. The base URL path of the web application is also often referred to as the servlet context.
To declare a variable with the same name as a variable defined in a superclass. We say the variable "shadows" the superclass's variable. Use the super keyword to refer to the shadowed variable or refer to it by casting the object to the type of the superclass.
A combination of a message's message digest, encrypted with the signer's private key, and the signer's certificate, attesting to the signer's identity. Someone receiving a signed message can get the signer's public key from the certificate, decrypt the encrypted message digest, and compare that result with the message digest computed from the signed message. If the two message digests agree, the recipient knows that the message has not been modified and that the signer is who he or she claims to be.
An applet packaged in a JAR file signed with a digital signature, allowing for authentication of its origin and validation of the integrity of its contents.
A Java class (or Java archive) that has a signature attached. The signature allows the recipient to verify the class's origin and that it is unmodified. The recipient can therefore grant the class greater runtime privileges.
A copy of an object that duplicates only values contained in the object itself. References to other objects are copied as references and are not duplicated. See also deep copy.
A primitive Java data type that's a 16-bit two's-complement signed number (in all implementations).
An interface that listens for connections from clients on a data port and connects the client data stream with the receiving application.
A GUI component that displays a value and a pair of small up and down buttons that increment or decrement the value. The Swing JSpinner can work with number ranges and dates as well as arbitrary enumerations.
A keyword that is a modifier applied to method and variable declarations within a class. A static variable is also known as a class variable as opposed to non-static instance variables. While each instance of a class has a full set of its own instance variables, there is only one copy of each static class variable, regardless of the number of instances of the class (perhaps zero) that are created. static variables may be accessed by class name or through an instance. Non-static variables can be accessed only through an instance.
A flow of data, or a channel of communication. All fundamental I/O in Java is based on streams.
A class used to represent textual information. The String class includes many methods for operating on string objects. Java overloads the + operator for string concatenation.
A class that extends another. The subclass inherits the public and protected methods and variables of its superclass. See also extends.
A keyword that refers to the same value as this: the instance of the class for which the current method (these keywords are valid only within non-static methods) was invoked. While the type of this is the type of the class in which the method appears, the type of super is the type of the superclass of the class in which the method appears. super is usually used to refer to superclass variables shadowed by variables in the current class. Using super in this way is equivalent to casting this to the type of the superclass.
A class extended by some other class. The superclass's public and protected methods and variables are available to the subclass. See also extends.
A keyword used in two related ways in Java: as a modifier and as a statement. First, it is a modifier applied to class or instance methods. It indicates that the method modifies the internal state of the class or the internal state of an instance of the class in a way that is not thread-safe. Before running a synchronized class method, Java obtains a lock on the class, to ensure that no other threads can modify the class concurrently. Before running a synchronized instance method, Java obtains a lock on the instance that invoked the method, ensuring that no other threads can modify the object at the same time.
Java also supports a synchronized statement that serves to specify a "critical section" of code. The synchronized keyword is followed by an expression in parentheses and a statement or block of statements. The expression must evaluate to an object or array. Java obtains a lock on the specified object or array before executing the statements.
A connection-oriented, reliable protocol. One of the protocols on which the Internet is based.
Within an instance method or constructor of a class, this refers to "this object" the instance currently being operated on. It is useful to refer to an instance variable of the class that has been shadowed by a local variable or method argument. It is also useful to pass the current object as an argument to static methods or methods of other classes.
There is one additional use of this: when it appears as the first statement in a constructor method, it refers to one of the other constructors of the class.
A single, independent stream of execution within a program. Since Java is a multithreaded programming language, more than one thread may be running within the Java interpreter at a time. Threads in Java are represented and controlled through the Thread object.
The throw statement signals that an exceptional condition has occurred by throwing a specified exception object. This statement stops program execution and resumes it at the nearest containing catch statement that can handle the specified exception object. Note that the throw keyword must be followed by an exception object, not an exception class.
The throws keyword is used in a method declaration to list the exceptions the method can throw. Any exceptions a method can raise that are not subclasses of Error or RuntimeException must either be caught within the method or declared in the method's throws clause.
The try keyword indicates a block of code to which subsequent catch and finally clauses apply. The try statement itself performs no special action. See also catch and finally for more information on the try/catch/finally construct.
A synonym for ISO 10646.
A connectionless unreliable protocol. UDP describes a network data connection based on datagrams with little packet control.
A universal standard for text character encoding, accommodating the written forms of almost all languages. Unicode is standardized by the Unicode Consortium. Java uses Unicode for its char and String types.
An encoding for Unicode characters (and more generally, UCS characters) commonly used for transmission and storage. It is a multibyte format in which different characters require different numbers of bytes to be represented.
A dynamic array of elements.
A theorem prover that steps through the Java bytecode before it is run and makes sure that it is well-behaved. The bytecode verifier is the first line of defense in Java's security model.
A JAR file with additional structure to hold classes and resources for web applications. A WAR file includes a WEB-INF directory for classes, libraries, and the web.xml deployment file.
An application that runs on a web server or application server, normally using a web browser as a client.
A universal markup language for text, using tags to add structure and meta-information to the content.
An XML-based language for describing styling and transformation of XML documents. Styling involves simple addition of markup, usually for presentation. XSLT allows complete restructuring of documents, in addition to styling.