- abstract
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.- API (Application Programming Interface)
An API consists of the functions and variables programmers use in their applications. The Java API consists of all
public
andprotected
methods of allpublic
classes in thejava.applet
,java.awt
,java.awt.image
,java.awt.peer
,java.io
,java.lang
,java.net
, andjava.util
packages.- applet
An embedded Java application that runs in the context of an applet viewer, such as a web browser.
- <APPLET> tag
An HTML tag that specifies an applet run within a web document.
- appletviewer
Sun’s application that implements the additional structure needed to run and display Java applets.
- application
A Java program that runs standalone; i.e., it doesn’t require an applet viewer.
- AWT (Abstract Window Toolkit)
Java’s platform-independent windowing, graphics, and user interface toolkit.
- boolean
A primitive Java data type that contains a truth value. The two possible values of a boolean variable are
true
andfalse
.- byte
A primitive Java data type that’s an eight-bit two’s-complement signed number (in all implementations).
- callback
A behavior that is defined by one object and then later invoked by another object when a particular event occurs.
- cast
A technique that explicitly converts one data type to another.
- catch
The
catch
statement introduces an exception-handling block of code following atry
statement. Thecatch
keyword is followed by an exception type and argument name in parentheses and a block of code within curly braces.- certificate
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.
- certificate authority (CA)
An organization that is entrusted to issue certificates, taking whatever steps are necessary to verify the identity for which it is issuing the certificate.
- char
A primitive Java data type; a variable of type
char
holds a single 16-bit Unicode character.- class
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 thestruct
keyword in C.- class loader
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.
- class method
A method declared
static
. Methods of this type are not passed implicitthis
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.- class path
The directory path specifying the location of compiled Java class files on the local system.
- class variable
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.- client
The application that initiates a conversation as part of a networked client/server application. See also server.
- compilation unit
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.
- compiler
- component
Any of the GUI primitives implemented in the
java.awt
package as subclasses ofComponent
. The classesButton
,Choice
, andTextField
(among many others) are components.- component architecture
A methodology for building parts of an application. It is a way to build reusable objects that can be easily assembled to form applications.
- composition
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.
- constructor
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.
- container
One of the
java.awt
classes that “contain” GUI components. Components in a container appear within the boundaries of the container. The classesDialog
,Frame
,Panel
, andWindow
are containers.- content handler
A class that is called to parse a particular type of data and that converts it to an appropriate object.
- datagram
A packet of data sent to a receiving computer without warning, error checking, or other control information.
- data hiding
See encapsulation.
- double
A Java primitive data type; a
double
value is a 64-bit (double-precision) floating-point number.- encapsulation
An object-oriented programming technique that makes an object’s data
private
orprotected
(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.- event
- event model
The overall design of the mechanism for sending and receiving events. The Java event model changed between the 1.0 and 1.1 releases in order to allow more explicit control over how and when events are delivered from sources to listeners.
- exception
A signal that some unexpected condition has occurred in the program. In Java, exceptions are objects that are subclasses of
Exception
orError
(which themselves are subclasses ofThrowable
). Exceptions in Java are “raised” with thethrow
keyword and received with thecatch
keyword. See also catch, throw, and throws.- extends
A keyword used in a
class
declaration to specify the superclass of the class being defined. The class being defined has access to all thepublic
andprotected
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 theextends
clause, its superclass is taken to bejava.lang.Object
.- final
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 afinal
class. Whenfinal
is applied to a variable, the variable is a constant; i.e., it can’t be modified.- finalize
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.- finally
A keyword that introduces the
finally
block of atry
/catch
/finally
construct.catch
andfinally
blocks provide exception handling and routine cleanup for code in atry
block. Thefinally
block is optional, and appears after thetry
block, and after zero or morecatch
blocks. The code in afinally
block is executed once, regardless of how the code in thetry
block executes. In normal execution, control reaches the end of thetry
block and proceeds to thefinally
block, which generally performs any necessary cleanup.- float
A Java primitive data type; a
float
value is a 32-bit (single-precision) floating- point number represented in IEEE 754 format.- garbage collection
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.
- GC
An abbreviation for garbage collection or garbage collector (or occasionally “graphics context”).
- graphics context
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.- GUI (graphical user interface)
A GUI is a user interface constructed from graphical push buttons, text fields, pull-down menus, dialog boxes, and other standard interface components. In Java, GUIs are implemented with the classes in the
java.awt
package.- hashcode
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.
- 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.
- hostname
The name given to an individual computer attached to the Internet.
- HotJava
A web browser written in Java, capable of downloading and running Java applets.
- ImageConsumer
An interface for receiving image data from an image source. Image consumers are usually implemented by the
awt.peer
interface, so they are largely invisible to programmers.- ImageObserver
An interface in the
java.awt.image
package that receives information about the status of an image being constructed by a particularImageConsumer
.- ImageProducer
An interface in the
java.awt.image
package that represents an image source (i.e., a source of pixel data).- implements
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 theextends
clause (if any). If animplements
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.- import
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 theCLASSPATH
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 ofimport
statements may appear in a Java program. They must appear, however, after the optionalpackage
statement at the top of the file, and before the first class or interface definition in the file.- inheritance
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.- inner class
A class definition that is nested within another class. An inner class functions within the lexical scope of another class.
- instance
An object. When a class is instantiated to produce an object, we say the object is an instance of the class.
- instance method
A non-
static
method of a class. Such a method is passed an implicitthis
reference to the object that invoked it. See also class method and static.- instanceof
A Java operator that returns
true
if the object on its left-hand side is an instance of the class (or implements the interface) specified on its right-hand side.instanceof
returnsfalse
if the object is not an instance of the specified class or does not implement the specified interface. It also returnsfalse
if the specified object isnull
.- instance variable
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.- int
A primitive Java data type that’s a 32-bit two’s-complement signed number (in all implementations).
- interface
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.
- internationalization
The process of making an application accessible to people who speak a variety of languages. Sometimes abbreviated I18N.
- interpreter
- introspection
The process by which a Java Bean provides additional information about itself, supplementing information learned by reflection.
- ISO 8859-1
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.
- ISO 10646
A four-byte character encoding that includes all of the world’s national standard character encodings. Also known as UCS. The 2-byte Unicode character set maps to the range 0x00000000 to 0x0000FFFF of ISO 10646.
- JavaBeans
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.
- Java Beans
Individual Java Beans are Java classes that are built using certain design patterns and naming conventions.
- JavaScript
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.
- Java WorkShop
Sun’s web browser-based tool written in Java for the development of Java applications.
- JDBC
The standard Java API for talking to an SQL (structural query language) database.
- JDK (Java Development Kit)
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.
- layout manager
An object that controls the arrangement of components within the display area of a container. The
java.awt
package contains a number of layout managers that provide different layout styles.- Latin-1
A nickname for ISO 8859-1.
- lightweight component
- local variable
A variable that is declared inside a single method. A local variable can be seen only by code within that method.
- long
A primitive Java data type that’s a 64-bit two’s-complement signed number (in all implementations).
- message digest
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.
- method
The object-oriented programming term for a function or procedure.
- method overloading
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.
- method overriding
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.
- Model-View-Controller (MVC) framework
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.
- modifier
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.
- NaN (not-a-number)
This is a special value of the
double
andfloat
data types that represents an undefined result of a mathematical operation, such as zero divided by zero.- native
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. Anative
method cannot beabstract
, but all other method modifiers may be used withnative
methods.- native method
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
new
is a unary operator that creates a new object or array (or raises anOutOfMemoryException
if there is not enough memory available).- null
null
is a special value that indicates a variable doesn’t refer to any object. The valuenull
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.- object
An instance of a class. A class models a group of things; an object models a particular member of that group.
- <OBJECT> tag
A proposed HTML tag that may replace the widely used but nonstandard
<APPLET>
tag.- package
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 theCLASSPATH
directory hierarchy before it can be accessed by the Java interpreter or other utilities. If thepackage
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.- <PARAM> tag
An HTML tag used within
<applet>
...
</applet>
to specify a named parameter and string value to an applet within a web page.- peer
The actual implementation of a GUI component on a specific platform. Peer components reside within a
Toolkit
object. See also toolkit.- primitive type
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.- private
The
private
keyword is a visibility modifier that can be applied to method and field variables of classes. Aprivate
field is not visible outside its class definition.- protected
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 onlyprotected
fields within themselves or within other objects that are subclasses; they cannot access protected fields within instances of the superclass.- protocol handler
Software that describes and enables the use of a new protocol. A protocol handler consists of two classes: a
StreamHandler
and aURLConnection
.- public
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. Apublic
method or variable is visible everywhere its class is visible. When none of theprivate
,protected
, orpublic
modifiers are specified, a field is visible only within the package of which its class is a part.- public key cryptography
A cryptographic system that requires two keys, a public key and a private key. The private key can be used to 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.
- reference type
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.
- reflection
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.
- Remote Method Invocation (RMI)
RMI is a native Java distributed object system. With RMI you can pass references to objects on remote hosts and invoke methods in them just as if they were local objects.
- root
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.- SecurityManager
The Java class that defines the methods the system calls to check whether a certain operation is permitted in the current environment.
- serialize
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.
- server
The application that accepts a request for a conversation as part of a networked client/server application. See also client.
- shadow
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.- signature
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.
- signed class
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.
- short
A primitive Java data type that’s a 16-bit two’s-complement signed number (in all implementations).
- socket
An interface that listens for connections from clients on a data port and connects the client data stream with the receiving application.
- static
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 eachstatic
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.- stream
A flow of data, or a channel of communication. All fundamental I/O in Java is based on streams.
- String
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.- subclass
A class that extends another. The subclass inherits the
public
andprotected
methods and variables of its superclass. See also extends.- super
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 ofthis
is the type of the class in which the method appears, the type ofsuper
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. Usingsuper
in this way is equivalent to castingthis
to the type of the superclass.- superclass
A class extended by some other class. The superclass’s
public
andprotected
methods and variables are available to the subclass. See also extends.- synchronized
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 asynchronized
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. Thesynchronized
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.- TCP (Transmission Control Protocol)
A connection-oriented, reliable protocol. One of the protocols on which the Internet is based.
- this
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.- thread
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.- throw
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 containingcatch
statement that can handle the specified exception object. Note that thethrow
keyword must be followed by an exception object, not an exception class.- throws
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 ofError
orRuntimeException
must either be caught within the method or declared in the method’sthrows
clause.- toolkit
The property of the Java API that defines the look and feel of the user interface on a specific platform.
- try
The
try
keyword indicates a block of code to which subsequentcatch
andfinally
clauses apply. Thetry
statement itself performs no special action. See also catch and finally for more information on thetry
/catch
/finally
construct.- UCS (universal character set)
- UDP (User Datagram Protocol)
A connectionless unreliable protocol. UDP describes a network data connection based on datagrams with little packet control.
- Unicode
A 16-bit character encoding that includes all of the world’s commonly used alphabets and ideographic character sets in a “unified” form (i.e., a form from which duplications among national standards have been removed). ASCII and Latin-1 characters may be trivially mapped to Unicode characters. Java uses Unicode for its
char
andString
types.- UTF-8 (UCS transformation format 8-bit form)
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.
- vector
- verifier
A theorem prover that steps through the Java byte-code before it is run and makes sure that it is well-behaved. The byte-code verifier is the first line of defense in Java’s security model.
Get Learning Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.