book banner gif

home button gif from book button gif software button gif

ch01 ch02 ch03 ch04 ch05 ch06 ch07 ch08 ch09 ch10 ch11 ch12 ch13 ch14 ch15 ch16

Glossary


| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |

The nature of this book is tutorial, not definitional. The body of the book introduces features of the Java language in the context of the needs that arise when writing programs, rather than presenting them in the formal style of a language specification.

For example, it is in the nature of a specification to lay down rules like, "It is not permitted for an action to follow itself." That's an actual quotation from The Java Language Specification (Gosling, Joy, and Steele, 1996), and it's a necessary part of the formal definition of the language. It is not, however, the kind of thing that I've included in the body of the book.

But I want to provide a court of first resort for "language lawyer" questions, without referring all such queries to the 821-page specification. This glossary is meant to cover that middle ground. It elaborates on several aspects of the language, such as the notion of volatile values, that did not fit into the narrative thread of the text but will interest readers with more advanced ambitions.

The style of these glossary entries is also more formal that that of the main text, which tends to place more emphasis on examples.

This glossary also contains many entries that relate to the problem domains in which Java will be used. That charter reaches well beyond the scope of the Java language and API packages. I hope that I have accurately anticipated the new Java programmer's most likely questions about the Internet, some fundamentals of computer science, and related subjects. The connections seemed obvious to me, but it required reference to more than half a dozen different books (as well as the writing of many test programs) to pin down these definitions: I hope, therefore, that the result is valuable to the reader.

Words in italic are explained elsewhere in this glossary.


A

abstract
An abstract class is one that defines at least one abstract method.

An abstract method is one that is declared, but not implemented. The abstract method declaration gives the return type, the method name, the types of the method's arguments, and a throws clause (if needed), but there is no method body.

A program can not construct an instance of an abstract class, but it can extend an abstract class with a subclass that implements some or all of the abstract methods that the subclass receives by inheritance. If any inherited abstract methods are not implemented by the subclass, the subclass is also abstract.

It is common for an abstract class to implement some of its methods: that is, those that define behaviors that must be supported by any subclass. An abstract class might also define instance variables that its subclasses will inherit. Contrast with an interface, which can define only abstract methods, and whose data members can only be static final members (available as named constants in the methods that the interface requires an implementing class to provide).

Access
By controlling access to an object's data and to the methods of its class, a programmer strikes a balance between two goals: The first goal is that of making a class provide useful services to other classes; the second goal is preserving the programmer's freedom to refine the way that a class does its job. See extends, package, public, protected, and private.

Action event
See event.

API
An Application Programming Interface is a formal statement of the services that a computer operating environment offers to the application programs that are written to run in that environment. The Java API consists of the language specification plus the descriptions of the standard packages java.lang, java.io, java.util, java.net, java.awt, and java.applet.

An API may deliberately exclude some known capabilities of the environment, typically because the designers wish to keep their options open for future refinements in the details of how those capabilities are provided and used. To write programs using such undocumented features may provide a short-lived benefit in capability or performance, but this is likely to be offset by future costs of revising the program.

If enough programs use undocumented features, however, beyond the published API, then the designers may find that it is no longer practical to make improvements-even much-needed improvements-that would require revision of applications. Java programmers should use Java's access control modifiers to prevent such dependencies from hindering the evolution of the classes that they create.

Applet
An applet is a Java program that runs in the context of an HTML browser or some other top-level execution environment. Rather than starting with method main(), an applet is launched by calling method init() of its primary class; the applet's execution is then controlled by other methods whose invocation is usually tied to the applet's coming in and out of view as the user navigates through different HTML pages.

It is currently common for applets to have tightly limited privileges, in particular for applets to be unable to use the local file system or to connect with any resources other than those at an applet's point of origin. Contrast with application.

A Java applet is typically transferred from an Internet host computer to the user's computer when the user reads an HTML page that contains a distinguishing tag with embedded information on where to find the file that holds the program's bytecodes. This process is described in Chapter 16. See also java.applet.

Application
Generally, an application is a program that does something intrinsically useful, as opposed to system software (such as an operating system or a Web browser) that only exists to reduce the difficulty of writing and using task-oriented programs.

In the specific domain of Java, an application is a program that can be executed directly by the host machine's operating system with the aid of a Java virtual machine, not requiring an HTML browser or comparable support environment. Unless deliberately constrained by invoking the method System.setSecurityManager(), with an instance of a subclass of java.lang.SecurityManager as the argument, an application has full access to the resources (both local and network-accessible) of its host environment.

A Java application begins by executing method main() of a Java class.. Contrast with applet.

Argument
An argument is a piece of information provided as input to a method. A method declaration states the types of the arguments that the method expects to receive, and gives the name by which an argument will be known within that method. That formal name has nothing to do with the argument's name in any other context.

The number and types of arguments expected by a method, combined with the name of the method, define the signature of that method. A class may overload more than one method with the same name, as long as each such method has a different signature as determined by the number and types of its arguments.

Array
This is a collection of numbered elements, each element being a value of the type that the array is declared to store.

A Java array can be recognized by the postfix operator [] appearing in a declaration, as in int[] for the type, "array of int," or by the square brackets around an expression that evaluates to a number for access to that element of the array, as in args[0] for the first element of an array named args. Array index values begin at 0.

The size of an array is fixed when the array is constructed. Attempting to access an element number beyond the end of the array will throw an instance of the Exception subclass ArrayIndexOutOfBoundsException.

ASCII
The American Standard Code for Information Interchange is a 7-bit code (defined for numeric values 0 through 127) for commonly used letters, numerals, punctuation, and control characters (such as form feed and new line). The printable ASCII characters are tabulated in Appendix B.

The ASCII control characters that are not obsolete have been assigned special literal representations, also tabulated in Appendix B. See also Unicode.

Assignment
An assignment operation associates a variable with a value. The Java Language Specification equates a Java variable with a C language "lvalue," and describes a Java variable as "a storage location." This can mean either of two things.

If the variable is of a simple type, then it names a piece of data. Only one variable is associated with any such value, and the type of the value is the type of the variable.

If the variable is of a reference type, then it names a reference to an object. More than one variable may refer to a single object, and the class of the value is the class of the variable or any subclass of the variable's class.

awt
See java.awt.


B

Binary
Having two possible values, usually rendered as 0 and 1. This can be proved to be the most economical way to represent information, after trading off the cost of representing a larger number of individual units of data against the cost of discriminating between less obviously different values. See Wiener, Norbert.

Bit
A contraction of binary digit, usually written using the symbols 0 or 1, representing the smallest possible unit of data or decision-making capability.

Block
As a noun, a block is a group of zero or more statements, delimited in Java by {}, that can appear wherever Java normally expects a single statement. A block can serve as a context for local variables. A block (possibly empty) is associated with any try, catch, or finally statement.

Blocking
As a verb, to block in Java is to suspend execution of a thread while it is sleeping or executing a method that is itself blocked. Blocking commonly takes place when a method is invoked that will not return until external input is provided, or when a thread is waiting for all higher-priority threads to become blocked so that the thread can resume execution, or when the synchronized keyword has been used to force other threads to wait for a thread to release its lock on some shared resource..

If a programmer desires to avoid blocking, stream methods like available() will tell a program how much data is currently ready for retrieval: The program can then adjust its request to ensure immediate continuation of processing.

boolean
Named after George Boole, this simple type can only assume either of the values true or false (as described in Chapter 4). Unlike most other languages, Java will not allow numeric values (such as 1 or 0) to be used where a boolean is expected: a boolean is not a bit, despite their conceptual similarity.

With a capital B, Boolean refers to the class of that name (described in Chapter 11). This book sometimes uses the capitalized word as an adjective when discussing logical operations in general.

The difference between Boolean and boolean will not be ignored by the compiler, which will not use context as a clue to figure out which was meant-though it's possible to overload identically named methods so that the same method name can be used with either Boolean or boolean arguments.

Branch
The ability to branch is one of the foundations of all programming. This term refers to the ability to choose between two or more paths through a program's sequence of instructions, based on conditions such as the values of data. Java's branching statements are the if and the switch, described in Chapter 7.

Break
To break is to leave a block of code before reaching the end in the normal fashion. Proper use of break is essential in switch statements and is often useful in a loop as well.

This term is also used, idiomatically, to describe aborting a program, typically by pressing a special key or combination of keys such as Ctrl-Break, Ctrl-C, or Command-period.

Byte
A group of eight bits, able to represent 256 different values.

When Java reads and writes bytes during input/output operations, it treats them as having the unsigned numeric values 0 through 255. This range of values is too large to be represented by Java's byte simple type, which can only represent the signed values -128 through 127. Many Java methods that work with an external byte use a 32-bit int to hold its numeric value.

Bytecodes
This is the term for the output of a standard Java compiler, usually packaged in a file with a name like ThisJavaClass.class. The same .class file can be downloaded and executed in a Java environment, such as a Web browser, on any Java-capable computer.

Normally, these bytecodes are verified, interpreted, and executed by a program called a virtual machine. In principle, a computer could be built that used Java bytecodes as its native instruction set without a virtual machine's intervention. Such Java chips are planned to be produced at various price/performance points for applications ranging from appliances (such as the canonical "smart doorknob") to workstations.

Bytecodes are also used by other languages, such as Smalltalk, that achieve portability to different types of computer by compiling to a virtual machine and providing a native implementation of that virtual machine on each target platform.


C

Casting
Also called coercion, casting allows the Java interpreter to treat a piece of data as being of a different type-and thereby makes it eligible for operations not normally allowed.

If a 64-bit long numeric value is known, for example, to have a value small enough to be representable by a 32-bit int, a program may safely cast the long to an int, and invoke methods that require an int upon the result.

Casting is not needed to assign an int to a long, since this is inherently a safe operation. See promotion.

Casting also allows movement down the class hierarchy. For example, if a method will accept an instance of InputStream as an argument, then it will also accept any instance of a subclass of InputStream in a manner analogous to the promotion of numeric types: The operator instanceof can be used to determine if an argument is actually an instance of a more specialized subclass, such as (in this case) PrintStream, in which case the argument could be cast to that type so that PrintStream methods could be applied to the result.

Certification
This is an alternative approach to ensuring safety when computer systems download applications from remote hosts. Certification uses cryptographic techniques to establish the origin of an application, presumably from some trusted source, and to confirm that it has not been altered during its handling by unknown or untrusted Internet relay nodes. See also verification.

class
In Java, or any other object-oriented language, a class is a description of a combination of state and behavior. A class is a central repository for descriptions of behaviors (called methods) of the class, and is a specification for building objects that can carry out those behaviors in ways that will vary according to each object's individual state.

Class method
See static.

Class variable
See static.

Code
To a programmer, this word has two meanings. Idiomatically, code refers to the written form of a program that is designed to be understandable by a person. This is also called source code. When you write a program, you are producing source code, and this process is sometimes called coding.

Code also means, generically, any mapping between two sets of symbols. For example, ASCII codes (see Appendix B) provide a standard way of translating letters, numerals, and punctuation marks to binary symbols that can easily be stored and processed.

Programmers do not use the word code in the everyday sense of a secret code, designed to obscure meaning. When programmers discuss such schemes, they use the term encryption.

Coercion
See casting.

Comparison
Programs perform comparisons to determine if two values have the same meaning (equality); to determine if two names refer to the same thing (identity); and to place values in rank order, as when sorting words or numbers or when deciding if a loop has completed the required number of repetitions.

Compiler
A compiler takes one form of a program and uses it to produce another form that is closer to being directly usable by a computer. A Java compiler takes Java source code and produces equivalent bytecodes. A just-in-time compiler or native compiler takes bytecodes (or, when working with other languages, source code) and produces native machine codes for the computer to be used for running that program. Contrast with interpreter.

Concurrent
Except for computers with more than one actual processor, any computer has only one set of hardware for storing and operating on values. In general, however, computers are so much faster than their users that a computer can turn its attention from one task to another, putting down one state and picking up another, dozens or hundreds of times a second.

The effect is one of doing more than one task at the same time, known informally as concurrent processing even though this is not literally an accurate description. Context switching is a more formal term that captures the difficulty of doing this reliably.

Conditional operator
An operator that defers evaluation of one or more operands until it determines whether the value of another operand makes the value of the deferred operand(s) irrelevant. Also known as a short-circuit evaluator, since the process of evaluating the operands may not make a full trip through the statement. The Java operators ||, &&, and ?: are conditional.

Console
Console interaction is also known as "glass TTY," where TTY is slang for teletype and refers to the typewriter-style terminals used to interact with early computers. A glass TTY is a computer screen that's providing only text-based, conversational interaction between the user and the computer. DOS and Unix typically provide such facilities, while the Macintosh environment doesn't normally offer this mode.

Constant
A constant is a value that can not be altered by assignment. Java reserves the keyword const, which some languages use to declare such a value, but Java does not use this keyword for this or any other purpose. To make a value unalterable, Java uses the keyword final.

Constructor
A constructor is a method that returns a new instance of a class. The common form of constructor is a method with the same name as that of the class, requiring no return-type declaration since the return type is the same as the method name. A class can define more than one such constructor, each with a different signature of argument types, to enable construction of objects based on different supplied information.

A class with no explicitly defined constructors will have, by default, a constructor that takes no arguments and returns an instance with default initializations of all instance variables. If a class defines one or more explicit constructors, it will not have a no-arg constructor unless this is explicitly defined as well.

A class may also have other constructors, not sharing the name of the class, but returning an instance of that class: For example, the statement InetAddress iAddr = InetAddress.getLocalHost(); declares and constructs a new instance of the Internet Protocol address encapsulation class by executing a static method of that class.

Container
This is the subclass of Component that serves as the abstract superclass of all Components that can hold other Components. Classes Panel and Window extend Container directly. Classes Applet (which extends Panel) and Frame (which extends Window) are the superclasses of most graphical applications.

Cybernetic
Strictly, cybernetic means "measuring differences and applying feedback to reduce those differences." This behavior is found in both natural and artificial systems.

Idiomatically, the prefix "cyber" has become a general indicator of any association (however vague) with computers. Where this is used to deceive, mislead, or shift blame from the programmer (or the programmer's employer) to the computer, Ted Nelson proposes the label "cybercrud."


D

Data
Programmers divide the universe into hardware, code, and data. Code makes hardware do things to data. Data is any part of the system that just gets passed around, without being asked to help.

That's not a very formal definition, but data is not a very formalizable term. To the Java virtual machine, bytecodes are data. To the file that gets read by that Java program, however, the bytecodes look like code while the file itself is data.

If that file contains HTTP commands to retrieve a digital photograph from a remote Internet node, then those HTTP commands could be said to be code while the digital photo file is data. If the digital photo file is a self-extracting archive, however, then it contains both code and data.

There is no absolute bottom to this hierarchy, since even a single bit may be either code or data to some part of an information processing system. What something is called depends on whether it's acting or being acted upon at that point in a process.

Deadlock
This is the state that exists when two or more units of program execution (in Java, threads) each acquire control of some resource to perform some task, but each is waiting for access to a resource controlled by another mutually deadlocked entity before proceeding.

Debugger
A programming tool that allows step-by-step execution and internal inspection of the data and behaviors of a program. It does not, unfortunately, detect or remove bugs.

Declaration
A declaration describes a piece of data, or a method, by name and by characteristics such as the data types with which it works. A compiler relies on declarations to determine that an identifier is being properly used.

Default
A default is any value or behavior that a program supplies unless otherwise instructed. Defaults reduce the number of individual situations that need to be enumerated, making programs easier to write and to understand. In Java, this idea appears in such contexts as the default constructor for a class of objects, the default values supplied by a constructor that takes no arguments or a reduced number of arguments, the default case in a multi-option switch statement, or the default value returned by a key from a Properties data structure

Digit
From a word meaning finger, commonly used to refer to a symbol occupying a single position in what may be a multi-digit representation of a value. The binary digits are 0 and 1, the octal digits are 0 through 7, the decimal digits are 0 through 9, the hexadecimal digits are 0 through 9 and A through F.

A digital computer uses internal representations of data that represent, in some way, digital notations. This contrasts with analog computers that use some continuously variable state, such as a voltage or an air pressure, to represent a value. Once preferred for modeling natural phenomena such as the flow of heat in a physical system, analog computers can no longer compete with the price/performance characteristics of digital technology, which has even replaced consumer analog products (such as the LP record) with digital hardware (such as the audio compact disc).

Domain Name System
The mapping between a numeric IP address and a more convenient alphanumeric name. For example, the IP address 206.66.184.204 is more easily remembered as www.pcweek.com.


E

Encapsulation
This refers to the hiding of low-level data within the controlled access mechanisms of an object. For example, the Color class conceals the actual hardware used to control the color that appears on a screen within the encapsulation of the 24-bit representation that the class presents to any program on any computer.

Equality
This is determined by the equals() method, which is inherited from class Object but should be overridden in an appropriate way by any subclass. The equals() method should return a boolean result. It should be reflexive, so that any object equals itself. It should be symmetric, so that the truth of x.equals(y) should be equivalent to the truth of y.equals(x). It should be transitive, so that the combined truth of x.equals(y) and y.equals(z) should be equivalent to the truth of x.equals(z). And it should be existential, so that x.equals(null) should always be false.

It is pointless to ask if null.equals(null): null belongs to no class, so there is no equals() method that can be invoked through this classless reference.

Equality is a less restrictive test than identity, since two variables of a reference type (i.e., two different names for what may or may not be distinct objects) may meet the relevant test of equality (e.g., two character strings containing the same sequence of characters) while not being identical (e.g., referring to separate instances of class String).

Evaluation
This is the process of going through a statement and replacing expressions with the values that they return. This may be a recursive process if an expression contains operands that are themselves expressions, as for example: aResult = i++ + j++ + (p = q + r);

Evaluation, normally an automatic process, can be more precisely controlled with proper use of the operators ||, &&, or ?: (see conditional operator).

Event
In traditionally designed programs, the user gets to provide input only when starting the program or when responding to the program's prompts for additional information.

In a graphical operating environment, a program should always be receptive to input, such as commands to resize a window, no matter what else the program is doing at the time.

This calls for an architecture based on capturing events, such as operations of the mouse, and associating those events with particular onscreen components such as a pushbutton or a scroll bar so that the program can take the appropriate action. The standard class java.awt.Event defines a vocabulary of descriptive names for integer values returned from event-detecting mechanisms to signal a user's activity.

Exception
An abnormal but foreseeable condition, such as a file being unavailable or a sleeping thread being interrupted. Also, an instance of the class Exception that provides a mechanism for packaging information about such a condition and transporting that information for processing by some other part of the program.

Execution
The process of retrieving instructions, determining their meaning, and carrying out the actions that they describe. During this process, the nature of a stream of symbols may shift from being data in one part of the process to being code in another part. Execution may also be broken into concurrent units of control, each called a process or thread depending on the degree of separation between those units.

extends
When one Java class extends another, the original class is called the superclass and the new class is called the subclass. A class that is declared final can not be extended.

A subclass in the same package as its superclass can use any instance variables and methods defined by its superclass, except for those declared to be private to the superclass. A subclass in a different package than its superclass can use only the public and protected members of the superclass, and can use those only if the superclass itself is declared as public.

A subclass can override variables and methods of its superclass, except for those declared final, with its own identically named variables and/or methods. These may either replace the corresponding members of the superclass, from the point of view of the subclass, or they may augment the facilities of the superclass by performing auxiliary computations before using the keyword super to invoke the superclass version.

A subclass often has an "is a" relationship with its superclass. For example, a Square "is a" Rectangle "is a" Shape; a Circle "is a" Shape. It would be logical for Circle and Rectangle both to be subclasses of Shape, with Square a subclass of Rectangle.


F

Feedback
A signal or symbol that results from some process and becomes input to the continuation of that process. For example, noise from a speaker that is picked up by a microphone is amplified, detected, and amplified again until the familiar squeal is heard. This is positive feedback. Negative feedback is the process of using a measure of error to guide a system in a way that reduces that error: this is the foundation of any cybernetic system.

final
This keyword denotes something that can not be changed. A final value can not be changed by assignment. A final method can not be overridden by a subclass. A final class can not be extended to create a new subclass.

Floating-point
Any numeric representation that combines a significand (representing the significant figures of a value) with an exponent (representing a scaling factor for that value).

For example, the decimal value 1000 can be represented exactly as an integer, or it can be represented as 1 times 103. When represented as an integer, this value is precise to the nearest 1. When written 1 x 103, it is precise to the nearest 0.5 x 103, or +/- 500. When written as 1.0 x 103, it is precise to the nearest 0.05 x 103, or +/- 50. Finite precision of floating-point formats requires care in making comparisons between values. The identity operator == should be used with care. A class that defines an appropriate version of the equals() method may be a more appropriate solution.

Function
In programming, this denotes a named series of statements that may or may not accept some input, but that always returns a value to the point in the program where that name was invoked. Contrast with procedure; see also method.


G

Garbage collection
The process of identifying data in memory that is no longer accessible by any part of a running program, and that may therefore be discarded. Normally an automatic process, this may be disabled for an entire session to maximize performance, or it may be initiated by calling the static method System.gc() before beginning a performance-critical task. See real-time.

go to
A famously controversial topic among programmers, the arbitrary transfer of control from one point in a program to another point in the program is either a useful convenience or a nightmare that leads to confusing and hard-to-modify programs. It can be proved that it is possible to construct any conceivable program without this semantic component in a language. Java excludes it.


H

Hashing
The process of generating a "key" value that can be used to determine a storage location for a piece of data. The ideal hashing function results in a uniform distribution of data over all available storage locations. Implications are discussed in Chapter 13.

Hexadecimal
A numeric notation using base 16 to condense binary symbols into a smaller number of digits. A single hexadecimal digit represents four binary digits: the binary symbol for 255 is 11111111, while the hexadecimal symbol is the more concise FF.

HTML
Hypertext Markup Language, the standard notation for describing graphically enhanced files in a format that can be interpreted and rendered on different types of computer.

This notation defines tags that are not displayed, but are interpreted by the HTML display program (commonly called a browser) as instructions to offer services such as jumping to another document when the user clicks the mouse while pointing to underlined text on the screen. See also applet and World Wide Web.

HTTP
Hypertext Transfer Protocol, the system of commands by which an Internet client computer most commonly requests HTML files from an Internet host machine. The means by which a Java program applies HTTP and retrieves Internet resources are described in Chapter 14.


I

Identity
This is the relationship of either being identical values (when speaking of simple types) or being different references to a single object (when speaking of reference types-i.e., of variables that correspond to objects). See equality.

implements
When a Java class implements an interface, it means that the behaviors of that class (as defined by its methods) meet a list of requirements defined by that interface. For example, a class that implements the interface Runnable must have a method named run(), which can be called to begin some activity when an instance of that class is used to construct a thread.

Implicit conversion
A value of one type can be used where Java expects a variable of a less restrictive type. For example, an int value will be accepted by a method that is declared to take a float argument, since any possible int value has a valid float representation. A FileInputStream will be accepted wherever an InputStream is required, since every FileInputStream is an InputStream.

Loss of precision may result when a long is implicitly converted to a double, since the latter has fewer significant digits even though it has a higher maximum value.

Given this method:



static float takeInt(float takeThat) {return takeThat;}


the Java compiler will let that method be called with arguments of type int or long, as well as the specified float, as in



System.out.println(takeInt(7));    // an int

System.out.println(takeInt(7L));   // a long

System.out.println(takeInt(7.0f)); // a float


but it will not accept



System.out.println(takeInt(7.0)); // a double


because a double will never be implicitly converted to a float.

Once such conversion takes place, the reverse conversion will never take place automatically even if the values involved make it safe to do so. See casting.

import
This keyword, followed by the name of a package or a packaged class, makes the public characteristics of the packaged class or classes accessible using the name of the class(es) alone, without using the package name in every reference.

The Java keyword import should not be confused with the C/C++ directive #include, which causes named files to be treated as if they were part of the file that contains the #include directive.

Importing a Java package only makes it accessible with a more concise notation, and aids the developer in applying different packages that take different approaches to similar functions. An import statement does not place any added burden on the Java compiler or affect the size of the resulting program.

Inheritance
See extends.

init()
The method name that is called when an applet is loaded by an HTML browser or other support environment. This method is only called once, as opposed to start() which is called whenever the applet comes into view-having been halted, when going out of view, by a call to stop(). When an applet will no longer be needed, its resources are freed by calling method stop() followed by method destroy().

Initialization
The first association of a value with a newly declared variable name. Static final variables must be initialized when declared; others can be initialized, by a statement of the same form as any other simple assignment statement, in a separate statement at any time before the variable's value is first used by an expression. Failure to comply with either of these rules will cause a compile-time exception.

Instance
An object fitting the description provided by a class, storing its own value of each instance variable defined by that class, and able to use the static variables and method definitions that are held in common by the class for use by all instances.

Instance variable
A variable defined by a class, of which each instance of that class stores its own value. Contrast with static variable.

instanceof
This operator allows a Java program to determine if an object is an instance of a particular class, perhaps allowing the program to make use of specialized characteristics of that object that could not otherwise be assumed.

Integer
This general term is a superset, not a synonym, of the simple type named int. An integer is any numeric type that counts values discretely and exactly. An integer can not represent fractional values, or values beyond the range determined by the integer type's represented number of bits.

Interface
An interface is a named set of method signatures and/or (implicitly) public static final values. When a class implements an interface, it makes a contract to respond to certain method calls. This gives Java multiple inheritance of interface, though the designers intentionally excluded the more error-prone multiple inheritance of implementation.

Internet
A network of interconnected computer networks, accessible to each other using the TCP/IP protocol, relying on dynamic routing of data between locations that are each identified by a unique IP address or a corresponding Domain Name System designation.

Interpreter
A program that takes an instruction stream as its input, and carries out the operations described by those instructions, translating those instructions to hardware operations as they are encountered. Contrast with compiler.

io See java.io.

IP address
An IP (Internet Protocol) address is a 32-bit number, usually written as a series of four numbers separated by periods with each number representing a single byte (and therefore having possible values 0 through 255). By convention, the address 127.0.0.1 is a local loopback address that a machine can use to talk to itself without external network hardware. On some machines, the command host will take a Domain Name System designation and return a numeric IP address, and vice versa.

Iteration
Repetitive execution of a series of instructions in the form of a loop, performed in Java under the control of a for, while, or do...while statement. Contrast with recursion.


J

java.applet
The standard package providing class and interface definitions that provide a foundation for constructing applet programs.

java.awt
The standard package providing class and interface definitions that provide a foundation for constructing a graphical user interface and for providing graphical output capabilities in a manner that permits the same Java program to run correctly on any system that provides a Java environment.

java.io
The standard package providing class and interface definitions that aid the programmer in defining input/output interactions in hardware-independent ways.

java.lang
The only standard package that is automatically imported by every program, providing facilities that are crucial to Java programming though not defined in the core of the language itself. These include the classes Object, System, Thread, Throwable, String, and Math.

java.net
The standard package providing class and interface definitions that ease the use of Uniform Resource Locators, IP addresses, and communication links that let programs communicate with each other and with these network-based resources.

java.util
A standard package providing class and interface definitions that include data structures (e.g., Vector and Hashtable) and the Date class for abstracting date and time representations. This package also provides the class Observable and the interface Observer that can be used to implement automatic notification of one object when a change occurs in another. The use of Observer and Observable is not covered in this book.

JavaScript
A language developed by Netscape and Sun, based on a Netscape language called LiveScript, with a syntactic resemblance to Java and with the ability to access the functions of Java classes.

JavaScript code is not compiled: It is embedded in an HTML page in source code form and executed by an interpreter when that page is viewed by a browser, unlike Java programs that are compiled to bytecodes that are stored in a separate file and downloaded based on directions embedded in an HTML tag.

JavaScript does not use data typing, it does not have an extensible class hierarchy, and it does not provide exception handling.


K

k (kilo)
Standing alone, abbreviates kilobyte. As a prefix or suffix, denotes a multiplier of 1,024.

key
In the context of a data structure such as the Java class Hashtable, a key is a value that is used to store and retrieve some other value. For example, a customer account number might be the key that is used to store and retrieve a customer's address.


L

lang
See java.lang.

Libraries
See packages.

Lightweight process See thread.

Literal
A value that is represented directly in a program, such as a numeric literal (2), a character literal ('a'), or an array literal ({13, 4, 5}).

Logical operator
A version of a Boolean AND or OR operator that performs short-circuit evaluation. See conditional operator.

Loop
A repetitive execution of some statement or block of statements, controlled in Java by a for, while, or do...while statement. See iteration.


M

M (Mega-)
Standing alone, abbreviates Megabyte. As a prefix or suffix, denotes a multiplier of 1,048,576 (1,0242).

Machine code
The codes that are translated directly by the hardware of a computer into actions for that hardware to perform upon data.

main()
The method of a class that is invoked when that class is executed by a stand-alone Java interpreter such as Sun's java or Microsoft's jview. Contrast with init().

Markup language
Any agreed-upon convention for annotating the contents of a file with information to be treated as describing other portions of the contents: For example, a notation that indicates a change of the font to be used when the document is printed or displayed. See HTML.

Math
See java.lang.Math.

Mega-
See M.

Member
A variable or method that participates in a class. This term covers both static variables (owned by the class) and instance variables (owned as distinct values by instances of the class), and covers both static methods (accessible outside the context of an instance) and normal methods (applied to an instance). Members of a class are always visible within the class, but their visibility to other classes is controlled by membership in a package and by the access modifiers public, protected, and private.

Method
A unit of description of behavior associated with a class. See also abstract, argument, branch, code, constructor, evaluation, event, execution, function, init(), iteration, loop, main(), member, operator, overloading, procedure, recursion, side effect, signature, statement, static, void, volatile. Contrast with variable.

Module
An identifiable unit of a program with a defined set of mechanisms for providing services to other units. Idiomatically, module suggests ease of understanding the structure of a system with a particular purpose, while object suggests ease of assembling units into new systems with purposes not specifically envisioned when those units were designed. Modules emphasize maintainability; objects emphasize reusability.

Multiple inheritance
See extends, inheritance, interface, subclass, and superclass.

Multitasking
See concurrent, deadlock, execution, process, and thread.

Multithreading
See concurrent, deadlock, execution, process, and thread.


N

Native
An adjective denoting tight coupling between some form of computer instruction and some particular operating environment, such as machine code for a particular processor or color attribute settings for a particular video display controller.

The Java keyword native denotes a method that executes native instructions. Such methods are not subject to Java's usual security protections and can not be called in an applet. Native methods are not covered in this book.

net
See java.net.

null
The only literal that can appear wherever Java normally expects a reference to an object. This name denotes an entity that is not an instance of any class: It is identical to itself, but has no applicable equals() method and does not pass the not equals() test with anything else. A reference to null is returned, for example, from an attempt to retrieve data from a Hashtable with a key that was never used to store a value in that table.


O

Object
The base class of all other classes, including arrays. Such fundamental notions as equals(), hashCode(), and toString() (for comparing objects' values, for storing objects in data structures, and for providing a printable representation of an object) originate in this class and are overridden in appropriate ways by subclasses. Generically, object also refers to an array or any other instance of any class.

Operator
A symbol, perhaps made up of multiple characters, that Java understands to direct some action by a program. Java's operators are tabulated in Appendix B.

Overflow
A condition resulting from assigning a numeric value to a variable whose symbolic format can not represent values that large. See also underflow.

Overloading
The act of defining more than one implementation of a method or an operator, with the desired implementation inferred from the types of the arguments supplied. Java provides overloading of methods, but does not allow programmer-defined overloading of operators. The operator + is overloaded to add numbers and concatenate strings; the operators &, |, and ^ are technically considered overloaded to operate on both integers and booleans, but their meaning is the same in both contexts.

Optimizing
A compiler is said to be an optimizing compiler if it does more than minimally translate source code into equivalent executable code. Possible optimizations, sometimes mutually exclusive, include attempting to minimize memory use and attempting to maximize execution speed. Optimizations performed by a particular compiler may be controlled by various option settings, some of which (called aggressive optimizations) may make assumptions about the relative independence of different parts of the program. It is possible that some optimization settings may cause a program to function differently than was intended by the programmer. Java's object disciplines, combined with proper use of the keyword volatile, reduce the likelihood of this.

Overriding
The act of defining a variable or method in a subclass with the same name as a variable or method in the superclass, modifying the characteristics normally acquired through inheritance.


P

Package
When a Java class is declared to be part of a package, and the class is not declared to be public, then the class is not accessible by classes outside its package; the non-private variables and methods of that class are directly accessible to other classes in the same package but not to those in other packages.

If a class is declared to be public, then its public components become additionally accessible by any classes in other packages; its protected components become additionally accessible to subclasses in other packages.

A class with no access modifier, or a variable or method within a class that is declared with no access modifier, is said to have package access. See public, protected, and private.

Packet
A unit of data transmitted via a communication link, containing both a messsage or some piece of a message plus additional information such as the origin, the destination, the sequence number, and/or error checking information used to verify correct receipt.

A packet-based network is distinguished from a circuit-based network that opens and maintains a path between two points until an exchange is completed. A circuit-based network need not allow for the possibility that units of data will be received in a different sequence than they were transmitted. A packet network may use different paths, with different transit times, between two points from one moment to the next, and must therefore allow for this possibility.

Parallel processing
See concurrent.

Parent
See superclass.

Precedence
The rank order in which operands within an expression are processed, in the absence of parentheses. Precedence groups are tabulated in Appendix B.

Precision
The degree to which a symbolic representation of numeric values can distinguish between closely spaced values. A float, with 23 bits of precision, can not distinguish between 5.0000001 decimal (about 101.000000000000000000000001101011010 binary) and 4.9999999 decimal (about 100.111111111111111111111110010100101 binary). A double, with 52 bits of precision, can distinguish these values from each other.

private
A variable or method declared as private within some class is not directly accessible to any other class, regardless of package or subclass relationships and regardless of whether the class itself is public.

Procedure
In programming, this denotes a named series of statements that may or may not accept some input, but which never returns a value to the point in the program where that name was invoked. A procedure is executed to perform some useful effect such as printing. Contrast with function; see also method.

Process
A unit of control over the process of executing a program, providing a separate address space and separate data contexts from those used by any other process. Also called a heavyweight process to emphasize the distinction between a process and a thread.

Promotion
When a Java expression is declared to use some type of value, it will accept a value of a more restricted type in its place, promoting the supplied value to the more general type (but losing access to more specialized behaviors available to the more restrictive type). See casting and implicit conversion.

protected
A variable or method declared as protected within some class is directly accessible to other classes in the same package, and to subclasses in other packages if the original class is declared to be public. Declaring a class or a class member as protected has no effect on its accessibility within a package.

Protocol
A set of data formatting conventions and operational commands used for data communications, as in networking. See HTTP, IP address, and TCP/IP.

public
A variable or method declared as public within some class is directly accessible to other classes in the same package, and to other classes in other packages if the original class is also declared to be public. Declaring a class or a class member as public has no effect on its accessibility within a package.


Q

Qualified name
The full name of an entity, such as a package or an instance variable, when used to avoid ambiguity.

For example, if a program implements two interface definitions named Inter1 and Inter2, and each interface defines a constant value named SOME_CONSTANT, then these values must be referred to by the qualified names Inter1.SOME_CONSTANT and Inter2.SOME_CONSTANT.

If two packages, package1 and package2, each include a class named SomeClass, then a program can not import both package1.* and package2.*, or import both package1.SomeClass and package2.SomeClass. It can make qualified references to either or both of these classes by using these full names.


R

Radix
The base value of a numbering system. For example, binary numbering uses a radix of 2, hexadecimal uses a radix of 16.

Real-time
When the maximum time to complete a computation is part of the specification of a system, that system is said to be a real-time system. For example, the program that shuts down a power plant if a serious failure is detected may have a required response time measured in seconds; the program that operates a car's anti-lock braking system may have a required response time measured in milliseconds, or even microseconds. Both are examples of real-time programs. System behaviors such as pauses for garbage collection may need to be specially constrained to meet the needs of real-time programs.

Real-time programs are often characterized by the need to work with data values that are continually being updated by external input such as sensors. This means that a compiler may not be correct in making its usual assumptions about which variables are subject to change, for example within a loop that continually updates a display. See also volatile.

Recursion
When a problem-solving process makes reference to itself, that process is said to be recursive. For example, the process of evaluating expressions includes the need to evaluate terms of the expression that are themselves expressions (see evaluation).

A recursive program, the Tak benchmark, appears in Chapter 13.

Reserved word
A word that can not be used as an identifier when writing programs, because the word has a special meaning to the language. Java's reserved words are tabulated in Appendix B.


S

Scripting
The use of an interpreted command language, such as JavaScript, to automate some aspect of the behavior of an end-user application. DOS batch files and word processor macros are also examples of scripting.

Short-circuit
See conditional operator.

Side effect
A change in the state of the variables or objects accessible to a program, typically resulting from an assignment, an increment, a decrement, or an invocation of a method that performs one or more of these operations. Also, an external effect such as causing a value to be printed. Contrasts with, but is not exclusive to, the return of a value from an expression.

Signature
The name of a method combined with the number and types of the arguments to the method, used (for example) to determine which of several overloaded methods to apply.

Signed
A binary data representation defined for both negative and positive values. Java's byte, short, int, long, float, and double are all signed numeric representations. See unsigned.

Simple type
In Java, one of the types boolean, char, byte, short, int, long, float, and double, that can be represented as values without being contained by an object. Also called primitive types.

Source code
The "human-readable" form of a program. Also known as code.

Standard packages
See java.lang, java.io, java.util, java.net, java.awt, java.applet.

Statement
Generally, a "sentence" in a procedural programming language. In Java, either an expression statement (such as a simple assignment) or a control statement (such as a for loop or a switch). A Java statement ends with a semicolon.

static
The modifier static indicates that a value or method is associated with a class rather than with an instance of that class.

For example, class Character defines the static method boolean isSpace(char testChar), which returns the value false from the expression Character.isSpace('a'). The method is called outside the context of any Character object.

The same class also defines the method boolean equals(Object testObject), which returns the value false from the expression (new Character('a')).equals(new Character(' ')). The non-static method is called in the context of a particular instance of Character.

A static variable or final static value is stored only once, in the class. A static variable modified by any instance of a class will appear with the modified value to any other instance. Contrast with instance variable.

String
An informal name for a character string, which is a composite data entity made up of one or more elementary character entities. Some languages provide this as a built-in data type, while Java provides a predefined class String that can hold a character string as a piece of data and can apply various methods to string-type data.

Strongly typed
A programming language is strongly typed if it requires the programmer to declare some kind of data type affiliation for every data entity, and if it enforces rules about the allowable use of data entities based on these declared types. When a Java program can not be compiled because a method is being called with arguments whose types do not match the signature of any method declaration using that method name, this is an example of strongly typed design. Contrast with untyped languages, e.g. JavaScript, in which any type of value can be assigned to any variable name.

Subclass
A class that extends another class, known as its superclass. A superclass may have any number of direct subclasses, each of which may have any number of subclasses in turn.

Subroutine
See method.

super
Within an instance method or constructor, or in an instance variable initializer, the keyword super names the superclass of the class of the object within whose context the method is executing. It can be used to gain access to a method or field defined on the superclass that's been shadowed by an identically named member in the subclass.

Superclass
The class named in the optional extends part of the declaration of some other class, known as a subclass of that superclass. A Java class can have at most one direct superclass, though there may be many levels of superclass above the first.

System software
A piece of software not intrinsically useful, but needed to either enable or improve some aspect of system operation. Obvious examples include an operating system, a device driver, or an antivirus scanner; borderline examples include a disk maintenance utility. A Java virtual machine or applet viewer is system software; a Java applet or application may be system software (e.g., Sun's HotJava browser or the Java WorkShop development system) or it may be an end-user application.


T

TCP/IP
Transmission Control Protocol/Internet Protocol. This is the composite name for a virtual circuit connection across the Internet (TCP) using the Net's low-level packet-management mechanisms (IP).

this
Within an instance method or constructor, or in an instance variable initializer, the keyword this names the object within whose context the method is executing. It can be used to gain access to an instance variable that's been shadowed by an identically named formal parameter to a method; to name the object as an argument to an alternative constructor, after the originally called constructor has modified its arguments or developed additional information; or to name the object as an argument to a method being invoked from some other class.

Thread
A unit of control over the process of executing a program. A Java thread is an object, which receives opportunities to continue execution under a priority-based scheduling scheme.

Thread scheduling behavior may vary in different implementations of the language: Ensuring desired behavior requires explicit attention to assignment of priorities and to yielding of control.

Threads are also called lightweight processes to emphasize their distinction from conventional (heavyweight) processes, which each provide a separate address space and separate data context. Threads share data, reducing the overhead of using them but requiring discipline to avoid unintended interference.

transient
This keyword advises a compiler that a value is not to be stored as part of a persistent representation of an object.


U

Underflow
A condition resulting from assigning a numeric value to a variable whose symbolic format can not represent values that small. See also overflow.

Unicode
A character set defining 16-bit codes (0000 through FFFF hexadecimal), subsuming the ASCII and ISO-Latin-1 character sets (through values 00FF), with additional ranges defined for Armenian, Bengali, Cyrillic, Devanagari, and many other non-Roman scripts.

Uniform Resource Locator
See URL.

Unsigned
A binary data representation that is mapped to values beginning with 0. See signed.

URL
A Uniform Resource Locator, or an instance of the class URL that encapsulates a URL reference as an input source or output destination.

util
See java.util.


V

Variable
As in algebra, a variable is a name for a number or some other quantity that takes part in a computation. A variable can take on different values through assignment, unless it is constrained against change by a declaration of final.

Verification
The process by which the Java environment establishes the safety of executing a set of bytecodes. The verifier is a program of the type known as a theorem prover, able to answer general questions without exhaustively testing all possibilities.

void
When a method is void, it does not return a value. For example, a method could be declared as:


void say(String aString { System.out.println(aString);}


or it could be declared as:



String say(String aString)

{ System.out.println(aString); return aString; }


The first merely has the side effect of sending its argument to the standard output stream; the second does the same thing, but could be invoked in an expression like:



String whatWasSaid = say("I said this.");


which returns the printed character string and, in this case, assigns it to the variable whatWasSaid.

volatile
This keyword advises a compiler that a value is subject to external change. For example, a loop might display a value that is updated by readings from an external sensor or is accessible from an unsynchronized thread. If the loop looks something like this,



int sensorReading = 0; // updated by sensorThread

while(true) { sensor.readout(sensorReading);

              Thread.sleep(10000);

                       // check again in 10 seconds

             }


then an optimizing compiler might assume that sensorReading is constant within the while loop. Compilers don't read comments.

When it enters the loop, the compiler might store the value sensorReading in an on-chip memory (called a register) and use that stored value thereafter. To prevent this, one would declare sensorReading as volatile.

Note, in particular, that a 64-bit double or long value that is not declared as volatile may be handled in read() or write() operations by two separate actions on the two 32-bit components of that value. Other operations may intervene. If these operations affect a shared double or long variable, the variable may wind up with a value that is an implementation-dependent artifact. The current specification encourages, and future versions may require, the more robust treatment of these operations as indivisible ("atomic") 64-bit actions.


W

Wiener, Norbert
Author of Cybernetics: Or Control and Communication in the Animal and the Machine, published in 1948 with a second edition in 1961. The following is quoted from the original introduction, written in 1947:

There is no rate of pay at which a United States pick-and-shovel laborer can live which is low enough to compete with the work of a steam shovel….The modern industrial revolution is similarly bound to devalue the human brain, at least in its simpler and more routine decisions….

[T]aking the second revolution as accomplished, the average human being of mediocre attainments or less has nothing to sell that it is worth anyone's money to buy.

When Wiener wrote this, the world's only real computer took up 1,800 square feet and used about 18,000 vacuum tubes. His prediction therefore showed amazing foresight. His 1950 book, The Human Use of Human Beings: Cybernetics and Society, explores issues that many companies and governments are only now beginning to confront.

Word
A word is a unit of binary data that's convenient to handle on a particular type of computer.

If a processor is built to work with 32-bit values, for example, then its most efficient instructions for storing and retrieving data will generally be those that operate on 32-bit words, aligned on 32-bit boundaries in the address space of the computer. A native compiler for that computer will try to optimize programs to operate in this manner.

Some advanced processors already use a 64-bit word, letting them address larger amounts of memory and process more complex types of data with greater speed. Java avoids the potential confusion of differing word sizes by defining its simple types as specific numbers of bits, regardless of the underlying hardware.

World Wide Web
The origin of the World Wide Web was a 1989 proposal by Tim Berners-Lee, a document and text-processing specialist at Geneva, Switzerland's European Laboratory for High Energy Physics, also known as CERN (from the acronym of the center's original French name, Conseil Europeen pour la Recherche Nucleaire). That proposal can be viewed, of course, on the Web, at http://www.w3.org/hypertext/WWW/Proposal.html.

The Web has been defined as the result of combining the Internet with HTML. Tautologically, the Web is what you can see with a Web browser.

This means that the Web is a different thing for every user, since each user's browser has access to different local files, different firewalled domains, and different value-added services-though all of these are in addition to the shared "public park" of the Internet, and it is this international pool of accessible resources that goes by the name of "The Web."

The convenience of the Web is not an unmixed blessing. Think of the relationship between a city and a subway system: Your view of the city is very different if you go from place to place by walking than if you just go down the stairs, drop a token in the turnstile, and pop up at the place where you wanted to go.

When you click on an underlined hot spot on a Web page, and see a linked page appear, you're taking the train instead of walking. The people who run the trains make it easy to get from one place to another, but the train only stops where they decide to build a station.

If the only Internet resources that you use are the ones that you can see via HTTP, you can cover a lot of ground-but you may never see some interesting places that lie between the subway stops.

Not all URLs begin with http://, and becoming comfortable with other types of Internet-accessible resources can expand your online world. The package java.net abstracts the Internet, not just the Web. Don't neglect its other applications.


X

Sorry, No Listings For This Letter


Y

Sorry, No Listings For This Letter

Z

Sorry, No Listings For This Letter


| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |

ch01 ch02 ch03 ch04 ch05 ch06 ch07 ch08 ch09 ch10 ch11 ch12 ch13 ch14 ch15 ch16

home button gif from book button gif software button gif
Hosted by www.Geocities.ws

1