Object-Oriented Programming with Java

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Class Path

The path searched by the compiler and interpreter for class definitions. The class path may be set by a command-line argument to either, or via an environment variable.

Delegation

The process by which an object passes on a message it has received to a sub-ordinate object. If inheritance is not available in a programming language, delegation is the most viable alternative for avoiding code duplication and promoting code reuse.

Compilation

The process of translating a programming language. This often involves translating a high level programming language into a low level programming language, or the binary form of a particular instruction set. The translation is performed by a program called a compiler. A Java compiler translates programs into bytecodes.

Client

The user of a service. A Web client requests resources from a Web server, for instance. When the client is an object, it is the sender of messages to its object servers.

Bookmark

Used by a Web browser to remember details of a Uniform Resource Locator (URL).

Hot Spot

An area in an image map with a particular significance. A program typically monitors movements of the mouse, and responds according to the actions associated with the hot spots over which it passes. This might include displaying different status information, for instance. Often, clicking the mouse on a hot spot is used to indicate that the program should activate an associated action. The term hot spot is also used to signify a computationally intensive part of a program, such as an inner loop. Such places are often a potential target for program optimization.

Interrupt

An asynchronous message sent to a process or thread that interrupts what it is currently doing. This usually results in an InterruptedException object being received by the interrupted thread. Waiting for an interrupt is an alternative to polling.

Logical Error

An error in the logical of a method or class. Such an error might not lead to an immediate runtime error, but could have a significant impact on overall program correctness.

Semantic Error

An error in the meaning of program. A statement may have no syntax errors, but might still break the rules of the Java language. For instance, if ivar is an int variable, the following statement is syntactically correct ivar = true; However, it is semantically incorrect, because it is illegal to assign a boolean value to an integer variable.

Runtime Error

An error that causes a program to terminate when it is being run.

Checked Exception

An exception that must be caught locally in a try statement, or propagated via a throws clause defined in the method header.

Java Virtual Machine (JVM)

An idealized machine whose instruction set consists of bytecodes. A Java program is compiled to an equivalent bytecode form and executed on an interpreter which implements the JVM.

Image map

An image divided into logical areas, each of which has a hot spot.

Icon

An image intended to communicate a language- or culturally-independent meaning.

Process

An individual thread-of-control to which an execution timeslice is allocated by an operating system.

Local Inner Class

An inner class defined within a method.

Interpretational Inner Class

An inner class whose role is to provide a view or interpretation of data belong to its enclosing class, but independent of the data's actual representation.

Filter Stream

An input-output class that filters or manipulates its stream of input- or output-data in some way. Two examples are DataInputStream and DataOutputStream.

Object

An instance of a particular class. In general, any number of objects may be constructed from a class definition (see singleton, however). The class to which an object belongs defines the general characteristics of all instances of that class. Within those characteristics, an object will behave according to the current state of its attributes and environment.

Marking Interface

An interface with no methods.

Exception

An object representing the occurrence of an exceptional circumstance - typically, something that has gone wrong in the smooth running of a program. Exception objects are created from classes that extend the Throwable class. See checked exception and unchecked exception.

Layout Manager

An object responsible for sharing the available space between multiple components within a graphical container

Immutable Object

An object whose state may not be changed. Objects of the String class are immutable, for instance - their length and contents are fixed once created.

Monitor

An object with one or more synchronized methods.

Operand

An operand is an argument of an operator. Expressions involve combinations of operators and operands. The value of an expression is determined by applying the operation defined by each operator to the value of its operands.

File System

An operating system makes it possible to use space on a computer's disk drives by imposing a structured file system on the disk storage. Each file system has its own conventions for the way in which files are named, folders and directories are structured, and large files are split into smaller pieces, for instance. It is not usually possible to transfer data directly from the file system of one operating system to that of a different operating system, because their conventions are likely to be incompatible.

Multiprogramming System

An operating system that is able to run multiple programs concurrently.

Increment Operator

An operator (++) that adds one to its operand. It has two forms: pre-increment (++x) and post-increment (x++). In its pre-increment form, the result of the expression is the value of its argument after the increment. In its post-increment form, the result is the value of its argument before the increment is performed. After the following, int a = 5, b = 5; int y,z; y = ++a; z = b++ y has the value 6 and z has the value 5. Both a and b have the value 6.

Short-circuit Operator

An operator in which only as many operands are evaluated as are needed to determine the final result of the operation. The logical-and (&&) and logical-or (||) operators are the most common example, although the conditional operator (?:) also only ever evaluates two of its three operands. See fully evaluating operator.

Conditional Operator

An operator taking three operands - a ternary operator. The conditional operator (?:) is used in the form bexpr ? expr1 : expr2 where bexpr is a boolean expression. The the boolean expression has the value true then the result of the operation is the value of expr1, otherwise it is the value of expr2.

Binary Operator

An operator taking two operands. Java has many binary operators, such as the arithmetic operators +, -, *, / and %, and the boolean operators &&, || and ^, amongst others.

Fully Evaluating Operator

An operator that evaluates all of its arguments to produce a result. Standard arithmetic operators, such as +, are fully evaluating. In contrast, some boolean operators, such as &&, are short-circuit operators.

Java Archive File

A Java Archive (JAR) file makes it possible to store multiple bytecode files in a single file.

Pixel

A `picture element' - typically a colored dot on a screen.

Initializer

A block defined at the outermost level of a class - similar to a method without a header. Initializer blocks are executed, in order, when an instance is created. They are executed before the constructor of the defining class, but after any super class constructor. They are one of the places in which blank final variables may be initialized.

Condition

A boolean expression controlling a conditional statement or loop.

Downcast

A cast towards an object's dynamic type - that is, `down' the inheritance hierarchy. For instance: // Downcast from Object to String String s = (String) o;

Octal Character Constant

A character constant in the form \ddd, where each d is an octal digit. This may be used for characters with a Unicode value in the range 0-255.

Anonymous Class

A class created without a class name. Such a class will be an sub class or an implementation of an interface, and is usually created as an actual argument or returned as a method result. For instance: quitButton.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ System.exit(0); } });

Nested Class

A class defined inside an enclosing class. See inner class.

Abstract Class

A class with the abstract reserved word in its header. Abstract classes are distinguished by the fact that you may not directly construct objects from them using the new operator. An abstract class may have zero or more abstract methods.

Final Class

A class with the final reserved word in its header. A final class may not be extended by another class.

Heterogeneous Collection

A collection of objects with different dynamic types. See homogeneous collection.

HSB Color Model

A color model based upon representing a color as three components: hue, saturation and brightness. This is sometimes known as the HSV color model - hue, saturation and value. See RGB Color Model.

Expression

A combination of operands and operators that produces a resulting value. Expressions have a resulting type, that affects the context in which they may be used. See boolean expression and arithmetic expression, for instance.

Big-endian

A common difference between machines is the order in which they store the individual bytes of multi-byte numerical data. A big-endian machine stores the higher-order bytes before the lower-order bytes. See little-endian.

Little-endian

A common difference between machines is the order in which they store the individual bytes of multi-byte numerical data. A little-endian machine stores the lower-order bytes before the higher-order bytes. See big-endian.

Edit-compile-run Cycle

A common part of the program development process. A source file is created initially and compiled. Syntax errors must be corrected in the editor before compiling it again. Once the program has been successfully compiled, it can be run. The program's execution might reveal logical errors, or the need for enhancements. A further edit-compile-run iteration is the result.

Iterator Pattern

A common pattern in which the contents of a collection are iterated over in order. The Iterator pattern frees a client of the data from needing details of the how the data is stored. This pattern is supported by the Iterator and ListIterator interfaces.

Host System

A computer system on which a process is run.

Magic Number

A constant value with a significance within a particular context. For instance, the value 12 could mean many different things - the number of hours you have worked today, the number of dollars you are owed by a friend, and so on. As far as possible, such values should be associated with an identifier that clearly expresses their meaning. final int maxSpeed = 50; If stored in a final variable, it is unlikely that any execution overhead will be incurred by doing so.

Constructor

A constructor is automatically called when an instance of its class is created. A constructor always has the same name as its class, and has no return type. For instance: public class Ship { public Ship(String name){ ... } ... } A class with no explicit constructor has an implicit no-arg constructor, which takes no arguments and has an empty body.

no-arg constructor

A constructor that takes no arguments. By default, all classes without an explicit constructor have a default no-arg constructor with public access. Its role is purely to invoke the no-arg constructor of the immediate super class.

If-else Statement

A control structure used to choose between performing one of two alternative actions. if(boolean-expression){ // Statements performed if expression is true. ... } else{ // Statements performed if expression is false. ... } It is controlled by a boolean expression.

If Statement

A control structure used to choose between performing or not performing further actions. if(boolean-expression){ // Statements performed if expression is true. ... } It is controlled by a boolean expression.

Deep Copy

A copy of an object in which copies of all the object's sub-components are also made. The resulting object might, in effect, be a clone of the original. See shallow copy for an alternative.

Shallow Copy

A copy of an object in which copies of all the object's sub-components are not also made. For instance, a shallow copy of an array of objects would result in two separate array objects, each containing references to the same set of objects as were stored in the original. See deep copy for an alternative.

Garbage Collector

A daemon thread that recycles objects to which there are no extant references within a program.

Enumerated Type

A data type - not directly available in Java - in which symbolic names are used for a sequence of constant numeric values. They facilitate the avoidance of magic numbers. They can be simulated in Java with fields in an interface, For instance: public interface States { public static final int Stop = 0, Go = 1; } However, the compiler type checking usually available with enumerated types is not available with this form.

Package declaration

A declaration used to name a package. This must be the first item in a source file, preceding any import statements. For instance: package java.lang;

Modal

A dialog is modal if its parent application is blocked from further activity until the dialog has completed. See non-modal.

non-modal

A dialog is non-modal if its parent application is not blocked from further activity while the dialog is being shown. See modal.

Inheritance

A feature of object-oriented programming languages in which a sub type inherits methods and variables from its super type. Inheritance is most commonly used as a synonym for class inheritance {class!inheritance}, but interface inheritance is also a feature of some languages, including Java.

Manifest File

A file held in a Java Archive (JAR) file, detailing the contents of the archive.

Append Mode

A file writing mode, in which the existing contents of a file are retained when the file is opened. New contents are appended to the existing.

Relative Filename

A filename whose full path is relative to some point within a file system tree - often the current working folder (directory). For instance: ../bin/javac.exe A relative filename could refer to different files at different times, depending upon the context in which it is being used. See absolute filename.

Absolute Filename

A filename whose full path is unambiguously given starting from the top (root) of a file system tree. For instance: c:\Java\bin\javac.exe

Blank Final Variable

A final variable that is not initialized as part of its declaration. Such a variable must be initialized in either an instance initialization block or all of the constructors for its class before it is used. A static blank final variable must be initialized in a static initialization block.

Overriding for Restriction

A form of method overriding in which the sub class version of a method calls the super class version first of all and then uses or manipulates the result or effects of that call in some way.

Overriding for Chaining

A form of method overriding in which the sub class version of a method checks to see whether it can respond to the message on its own and only calls the super class version of the method.

Overriding for breadth

A form of method overriding in which the sub class version of a method implements its own behavior within the context of the attributes and behavior of the sub class and then calls the super class version so that it can perform a similar task within the super class context.

Hash Function

A function used to produce a hash code from the arbitrary contents of an object. Classes can override the hashValue method, inherited from the Object class, to define their own hash function.

Internet

A global network of many interconnected networks.

Double Buffering

A graphics technique used to smooth animation. The next version of an image is drawn `behind the scenes' and then displayed in its entirety when the drawing is complete. The assumption is that it will be relatively quick to display the fully drawn image, compared to the time it takes to compute and draw it.

Module

A group of program components, typically with restricted visibility to program components in other modules. Java uses packages to implement this concept.

Radio Buttons

A group of selectable components in which only one component may be selected. Selection of one of the group causes the previously selected component to be deselected.

Disk Drive

A hardware device used to store data. They come in many forms, such as compact disks, floppy disks and hard disks.

Scope

A language's scope rules determine how widely variables, methods and classes are visible within a class or program. Local variables have a scope limited to the block in which they are defined, for instance. Private methods and variables have class scope, limiting their accessibility to their defining class. Java provides private, package, protected and public visibility.

Pipe

A linkage between two program components. One component acts as a source of data, and writes into the pipe. A second components acts as a receiver (sink) for the data and reads from the pipe. See PipedInputStream and PipedOutputStream.

Infinite Loop

A loop whose termination test never evaluates to false. Sometimes this is a deliberate act on the part of the programmer, using a construct such as while(true) ... or for( ; ; ) ... but it can sometimes be the result of a logical error in the programming of a normal loop condition or the statements in the body of the loop.

Method Overriding

A method defined in a super class may be overridden by a method of the same name defined in a sub class. The two methods must have the same name and number and types of formal arguments. Any checked exception thrown by the sub class version must match the type of one thrown by the super class version, or be a sub class of such an exception. However, the sub class version does not have to throw any exceptions that are thrown by the super class version. It is important to distinguish between method overriding and method overloading. Overloaded methods have the same names, but differ in their formal arguments. See overriding for breadth, overriding for chaining and overriding for restriction.

Mutator Method

A method specifically designed to allow controlled modification of a private attribute of a class. By convention, we name mutators with a set prefix followed by the name of the attribute being modified. For instance, the mutator for an attribute named speed would be setSpeed. By making an attribute private, we prevent objects of other classes from altering its value other than through its mutator. The mutator is able to check the value being used to modify the attribute and reject the modification if necessary. In addition, modification of one attribute might require others to be modified in order to keep the object in a consistent state. A mutator method can undertake this role. Mutators are used both to grant safe access to the value of a private attribute and to protect attributes from modification by objects of other classes. The latter goal is achieved by choosing an appropriate visibility for the mutator.

Bridging Method

A method that provides a bridge between the methods of a class's public interface and its private implementation. Bridging methods will typically have non-public visibility.

Final Method

A method with the final reserved word in its header. A final method may not be overridden by a method defined in a sub class.

Native Method

A method written in a language other than Java, but accessible to a Java program. Native methods are beyond the scope of this book.

Modem

A modulator-demodulator. A hardware device used to connect a digital computer to an analogue telephone network by turning analogue signals into digital signals, and vice versa.

Package

A named grouping of classes and interfaces that provides a package namespace. Classes, interfaces and class members without an explicit public, protected or private access modifier {access!modifier} have package visibility. Public classes and interfaces may be imported into other packages via an import statemen

Arpanet

A network that was a forerunner of the global Internet.

Base Case

A non-recursive route through a recursive method.

Instance Variable

A non-static field of a class. Each individual object of a class has its own copy of such a field. This is in contrast to a class variable which is shared by all instances of the class. Instance variables are used to model the attributes of a class.

Port

A number used by a process to communicate with another process across a network, using the Transmission Control Protocol (TCP) or User Datagram Protocol (UDP), for instance. See TCP endpoint {Transmission Control Protocol (TCP)!endpoint}.

Real Number

A number with an integer and a fractional part. The primitive types double and float are used to represent real numbers.

Java 2 SDK

A particular implementation of the abstract functionality described in Sun's specification of the Java 2 Platform.

Attribute

A particular usage of an instance variable. The set of attribute values held in a particular instance of a class define the current state of that instance. A class definition may impose particular constraints on the valid states of its instances by requiring that a particular attribute, or set of attributes, do not take on particular values. For instance, attributes holding coursework marks for a class should not hold negative values. Attributes should be manipulated by accessor and mutator methods.

Model-view Pattern

A pattern in which the representation of data (the model) is kept separate from its visualization (the view). Such decoupling makes it easier to change the underlying data representation, or provide multiple views, for instance. Quite often a third element is added to create the Model-View-Controller (MVC) pattern. In the MVC pattern, those elements of the system which are able to control or modify the data (the model) are also defined separately.

Factory Pattern

A pattern of class definition that is used as a generator of instances of other classes. Often used to create platform- or locale-specific implementations of abstract classes or interfaces. This reduces coupling between classes as it frees the factory's client from a need to know about particular implementations.

Global Variable

A phenomenon that is more usually regarded as being a problem in structured programming languages than in object-oriented languages. In a structured programming language, such as Pascal or C, a global variable is one defined outside the procedures and functions of a program. It is difficult to keep track of the usage of such a variable as it is readable and writable by the whole program or module in which it is defined. This makes such variables a common source of logical errors. In fact, instance variables pose a similar problem within class definitions, since Java's scope rules make them accessible to all methods defined within a class. This is one of the reasons why we prefer to channel access to instance variables through accessor and mutator methods even within a class.

Comment

A piece of text intended for the human reader of a program. Compilers ignore their contents.

Security Policy

A policy used to limit access by an applet to the resources of a host system.

Java

A portable high level programming language released by Sun Microsystems.

Integer

A positive or negative whole number. The primitive types byte, short, int and long are used to hold integer values within narrower or wider ranges.

Program Counter

A program counter is an integral part of a computer's Central Processing Unit. It contains a reference to the memory address of the next instruction to be fetched, ready to be executed during the next fetch-execute cycle. Immediately following an instruction fetch, the program counter is moved on to refer to the next instruction, before the current instruction is executed. The normal sequential execution of a series of instructions may be changed by executing a branch instruction, which stores a new instruction address into the program counter.

Interpreter

A program which executes a translated version of a source program by implementing a virtual machine. Interpreters typically simulate the actions of an idealized Central Processing Unit. An interpreter for Java must implement the Java Virtual Machine (JVM) and executes the bytecodes produced by a Java compiler. The advantage of using an interpreter for Java is that it make the language more portable than if it were a fully compiled language. The bytecode version of a program produced by a Java compiler may be run on any interpreter implementing the JVM.

Identifier

A programmer-defined name for a variable, method, class or interface.

Pattern

A recurring theme in class design or usage. Interfaces such as Iterator encapsulate a pattern of access to the items in a collection, while freeing the client from the need to know details of the way in which the collection is implemented.

Out-of-bounds Value

A redundant value used to indicate that a different action from the norm is required at some point. The read method of InputStream returns -1 to indicate that the end of a stream has been reached, for instance, instead of the normal positive byte-range value.

Object Reference

A reference to an object. Languages other than Java use term's such as address or pointer. It is important to keep the distinction clear between an object and its reference. A variable such as argo Ship argo; is capable of holding an object reference, but is not, itself, an object. It can refer to only a single object at a time, but it is able to hold different object references from time to time.

Call-by-value

A semantics of passing an argument to a method in which a copy of the actual argument value is taken and placed in a separate memory location, represented by the corresponding formal argument. As a result, assignment to a formal argument within a method can have no effect on the value stored in the actual argument. This principle is often misunderstood in Java. It does not mean that an object referred to by an actual argument cannot be modified via the formal argument. Consider the following example of sorting the array referred to by the variable numbers: Arrays.sort(numbers); The sort method will change the order of the values stored in the object referred to by numbers. However, it is impossible for the sort method to change which array numbers refers to - a sorted copy, for instance. Some languages provide an argument passing semantics known as call-by-reference, in which an actual argument's value may be changed. Java does not provide this, however.

Application Programming Interface (API)

A set of definitions that you can make use of in writing programs. In the context of Java, these are the packages, classes, and interfaces that can be used to build complex applications without having to create everything from scratch.

Protocol

A set of rules for interaction between two processes. A protocol is usually specified in a Uniform Resource Locator (URL) to indicate how a particular resource should be transferred from a Web server to the requesting client.

Livelock

A situation in which a thread waits to be notified of a condition but, on waking, finds that another thread has inverted the condition again. The first thread is forced to wait again. When this happens indefinitely, the thread is in livelock.

Memory Leak

A situation in which memory that is no longer being used has not been returned to the pool of free memory. A garbage collector is designed to return unreferenced objects to the free memory pool in order to avoid memory leaks.

Race Hazard

A situation that arises between multiple threads sharing a resource. A race hazard arises when one thread's assumptions about the state of a resource are invalidated by the actions of another thread.

Deadlock

A situation that arises when two threads each acquires the lock to one of a set of resources that they both need.

Micro-chip

A small electronic device used to build computers and other electronic equipment. Chips are commonly used to supply the memory and processing components of a computer. See Central Processing Unit.

Runtime Stack

A stack structure maintained by the Java Virtual Machine that records which methods are currently being executed. The most recently entered method will be at the top of the stack and the main method of an application will be near the bottom.

Inconsistant State

A state that an object should not be in. A class needs to be carefully designed in order to ensure that none of its instances can get into an inconsistent state. An example of an inconsistent state might be a football team with too many players on the field.

Declaration and Initialization

A statement in which a variable is declared and immediately given its initial value. Three examples of declaration and initialization are int numStudents = 23; Ship argo = new Ship(); Student[] students = new Student[numStudents]; Instance variables that are not explicitly initialized when they are declared have a default initial value that is appropriate to their type. Uninitialized local variables have an undefined initial value.

Control Structure

A statement that affects the flow of control within a method. Typical control structures are loops and if statements.

Import Statement

A statement that makes the names of one or more classes or interfaces available in a different package from the one in which they are defined. Import statements follow any package declaration {package!declaration}, and precede any class or interface definitions.

Continue Statement

A statement that may only be used inside the body of a loop. In the case of a while loop or do loop, control passes immediately to the loop's terminating test. In the case of a for loop, control passes to the post-body update expression.

Return Statement

A statement used to terminate the execution of a method. A method with void return type may only have return statements of the following form return; A method with any other return type must have at least one return statement of the form return expression; where the type of expression must match the return type of the method.

Protected Statement

A statement within the try clause of a try statement.

Functional Programming

A style of programming associated with languages such as Haskell. Functional programming languages are more closely tied to a mathematical concept of `function' than imperative programming languages. This makes it easier to apply program-proving techniques and logical reasoning to functional programs. In particular, functional programs do not use the concept of variables in the traditional sense, i.e. a memory location whose contents might be changed from time to time as a program executes.

Parallel Programming

A style of programming in which statements are not necessarily executed in an ordered sequence but in parallel. Parallel programming languages make it easier to create programs that are designed to be run on multi-processor hardware, for instance. Java's thread features support a degree of parallel programming.

Operator

A symbol, such as -, == or ?: taking one, two or three operands and yielding a result. Operators are used in both arithmetic expressions and boolean expressions.

Assembly Language

A symbolic language corresponding closely to the instruction set of a Central Processing Unit. The program used to translate a program written in assembly language is called an assembler.

Instance

A synonym for object. Objects of a class are instantiated when a class constructor is invoked via the new operator.

Peer

A term used of the Abstract Windowing Toolkit (AWT) to refer to the underlying classes that provide the platform-specific implementation of component classes.

Case Sensitive

A test that is sensitive to whether a character is upper-case (e.g., 'A') or lower-case (e.g., 'a').

Hash Code

A value returned by a hash function. A hash code can be used as an index into a random-access data structure, providing an efficient mapping between an object and its location. Used by classes such as HashMap

null reference

A value used to mean, `no object'. Used when an object reference variable is not referring to an object.

Class Constant

A variable defined as both final and static.

Local Variable

A variable defined inside a method body.

Out of Scope

A variable is in scope as long as the program's flow of control is within the variable's defining block. Otherwise, it is out of scope.

Loop Variable

A variable used to control the operation of a loop, such as a for loop. Typically, a loop variable will be given an initial value and it is then incremented after each iteration until it reaches or passes a terminating value.

Constant

A variable whose value may not be changed. In Java, these are implemented by final variables.

Final Variable

A variable with the final reserved word in its declaration. A final may not assigned to once it has been initialized. Initialization often takes place as part of its declaration. However, the initialization of an uninitialized final field (known as a blank final variable) may be deferred to the class's constructor, or an initializer.

IP Address

An Internet Protocol (IP) address for a networked computer. Currently, IP addresses consist of four byte values, written in dotted decimal notation, such as 129.12.0.1. In future, IP addresses will be sixteen bytes long to accommodate the expansion in the number of networked computers.

Internet Service Provider

An Internet Service Provider (ISP) provides connections to the Internet for users who do not have their own network. The ISP provides such user with their own IP address that enables them to interact with other computers attached to the Internet.

Round Robin Allocation

An allocation of timeslices that repeatedly cycles around a set of eligible threads in a fixed order.

Applet

Applets are Java programs based around the Applet or JApplet classes. They are most closely associated with the ability to provide active content within Web pages. They have several features which distinguish them from ordinary Java graphical applications, such as their lack of a user-defined main method, and the security restrictions that limit their abilities to perform some normal tasks.

Daemon Thread

Daemon threads are non-user threads. They are typically used to carry out low-priority tasks that should not take priority over the main task of the program. They can be used to do useful work when all other user threads are blocked. The garbage collector is one example of a daemon thread.

Locale

Details which are dependent upon conventions and customs adopted by a particular country or culture. Within programs, this affects issues such as number and date formatting, for instance. Designers of classes should be sensitive to the locale-specific issues that might apply to users.

Priority Level

Each thread has a priority level, which indicates to the scheduler where it should be placed in the pecking order for being run. An eligible un-blocked thread with a particular priority will always be run before an eligible thread with a lower priority.

Boundary Error

Errors that arise from programming mistakes made at the edges of a problem - indexing off the edge of an array, dealing with no items of data, loop termination and so on. Boundary errors are a very common type of logical error.

Catching Exceptions

Exceptions are caught within the catch clause of a try statement. Catching an exception gives the program an opportunity to recover from the problem or attempt a repair for whatever caused it.

Propagation

If an exception is thrown within a method, and there is no appropriate exception handler within the method, the exception may be propagated to the caller of the method. For a checked exception, the method must contain a throws clause in its header. A throws clause is not necessary for an unchecked exception {exception!unchecked} to be propagated.

Finalization

Immediately before an object is garbage collected, its finalize method is called. This gives it the opportunity to free any resources it might be holding on to.

Continuous Simulation

In a continuous simulation, time ticks past at a regular rate that is applicable to the particular simulation scenario. At each tick, all the objects in the simulation are informed of the passage of time and updated accordingly. See discrete simulation for an alternative form of simulation.

Discrete Simulation

In a discrete simulation, time passes at an irregular rate that is determined by the primary events of interest in the simulation. See continuous simulation for an alternative form of simulation

Argument

Information passed to a method. Arguments are also sometimes called parameters. A method expecting to receive arguments must contain a formal argument declaration for each as part of its method header. When a method is called, the actual argument values are copied into the corresponding formal arguments.

Bytecode

Java source files are translated by a compiler into bytecodes - the instruction set of the Java Virtual Machine (JVM). Bytecodes are stored in .class files.

Primitive Type

Java's eight standard non-class types are primitive types: boolean, byte, char, double, float, int, long and short.

High Level Programming Language

Languages such as Java, C++, Ada, etc. which provide programmers with features such as control structures, methods, classes, packages, etc. These features are largely independent of any particular instruction set, and hence programs written in these languages tend to be more portable than those written in low level programming languages.

Aliases

Multiple references to a single object. Messages may be sent to the object via any of its aliases. A resulting state change will be detectable by all.

MIME

Multipurpose Internet Mail Extensions (MIME) are rules that make it possible to use electronic mail to send content other than simple text.

Hexadecimal

Number representation in base 16. In base 16, the digits 0 to 9 and the letters A to F are used. A represents 10 (base 10), B represents 11 (base 10), and so on. Digit positions represent successive powers of 16.

Binary

Number representation in base 2. In base 2, only the digits 0 and 1 are used. Digit positions represent successive powers of 2.

Octal

Number representation in base 8. In base 8, only the digits 0 to 7 are used. Digit positions represent successive powers of 8.

Low Level Programming Languages

Often known as `assembly languages', these provide little more than the basic instruction set of a particular Central Processing Unit. Hence programs written in low level programming languages tend to be less portable than those written in high level languages.

Application

Often used simply as a synonym for program. However, in Java, the term is particularly used of programs with a Graphical User Interface (GUI) that are not applets.

Boolean

One of Java's primitive types. The boolean type has only two values: true and false.

For Loop

One of Java's three control structures used for looping. The other two are the while loop and do loop. A for loop consists of a loop header and a loop body. The header consists of three expressions separated by two semicolons and one or more of these may be omitted. The first expression is only evaluated once, at the point the loop is entered. The middle expression is a boolean expression representing the loop's termination test. An empty expression represents the value true. The third expression is evaluated after each completion of the loop's body. The loop terminates when the termination test gives the value false. The statements in the loop body might be executed zero or more times.

Do Loop

One of Java's three control structures used for looping. The other two are the while loop and for loop. A do loop consists of a loop body and a boolean expression. The condition is tested after the loop body has been completed for the first time and re-tested each time the end of the body is completed. The loop terminates when the condition gives the value false. The statements in the loop body will always be executed at least once.

Logical Operators

Operators, such as &&, ||, &, | and ^ that take two boolean operands and produce a boolean result. Used as part of a boolean expression, often in the condition of a control structure.

Relational Operators

Operators, such as <, >, <=, >=, == and !=, that produce a boolean result, as part of a boolean expression.

Finally Clause

Part of a try statement that is always executed, either following the handling a caught exception, or normal termination of the protected statements.

Portable

Portability is the quality of a program that makes it possible to run it on different types of computers. Programs written in low level languages are typically not very portable because they are usually closely tied to a specific instruction set or characteristics of a particular type of Central Processing Unit. Programs written in high level languages tend to be more portable, but might still make non-portable assumptions about a computer's underlying file system, for instance. Java programs are highly portable because a lot of machine- and file-system specific details are hidden from the programmer.

Object-oriented Language

Programming languages such as C++ and Java that allow the solution to a problem to be expressed in terms of objects which belong to classes.

Protected Access

Protected access is available to a class member prefixed with the protected access modifier. Such a member is accessible to all classes defined within the enclosing package, and any sub classes extending the enclosing class.

Random Access Memory (RAM)

Random access memory, or RAM, is memory whose contents are easily accessible to the processing components of a computer. In particular, the time it takes to read and write to a particular part of the memory does not depend on the address of the location to be read or written. This is in contrast to something like video tape which is accessed serially and, hence, the time it takes to read or write to any part of it depends on how far away the location is.

Recursion

Recursion results from a method being invoked when an existing call to the same method has not yet returned. For instance: public static void countDown(int n){ if(n >= 0){ System.out.println(n); countDown(n-1); } // else - base case. End of recursion. } See direct recursion, indirect recursion and mutual recursion for the different forms this can take.

Infinite recursion

Recursion that does not terminate. This can result from any of direct recursion, indirect recursion or mutual recursion. It is usually the result of a logical error, and can result in stack overflow.

Direct Recursion

Recursion that results from a method calling itself.

Indirect Recursion

Recursion that results from method Y calling method X, when an existing call from X to Y is still in progress.

Mutual Recursion

Recursion that results from two methods calling each other recursively.

Iteration

Repetition of a set of statements, usually using a looping control structure, such as a while loop, for loop or do loop.

Encapsulation

Safeguarding the state of an objects by defining its attributes as private and channeling access to them through accessor and mutator methods.

Deprecated

Something that has been made obsolete by later versions of the API. Deprecated methods should not be used because there is no guarantee that they will continue to exist in future versions.

IEEE 754

Standard 754-1985 issued by the Institute of Electrical and Electronic Engineers for binary floating point arithmetic. This is the standard to which Java's arithmetic conforms.

Block

Statements and declarations enclosed between a matching pair of curly brackets ({ and }). For instance, a class body is a block, as is a method body. A block encloses a nested scope level.

Punctuation

Symbols such as commas and semicolons, which a compiler uses to understand the structure of a program.

Implements Clause

That part of of a class header that indicates which interfaces are implemented by the class. A class may implement more than one interface. See multiple inheritance.

First in, first out

The (FIFO) semantics of a queue data structure. Items are removed in the order in which they arrived in the queue, so older items are always removed before newer ones. See last in, first out. floating point number

Last in, first out

The (LIFO) semantics of a stack data structure. Items are removed in the opposite order to which they arrived in the stack, so newer items are always removed before older ones. See first in, first out.

Abstract Windowing Toolkit

The Abstract Windowing Toolkit (AWT) provides a collection of classes that simplify the creation of applications with graphical user interfaces. These are to be found in the java.awt packages. Included are classes for windows, frames, buttons, menus, text areas, and so on. Related to the AWT classes are those for the Swing packages.

File Transfer Protocol

The File Transfer Protocol (FTP) defines a standard set of rules that make it possible to transfer a file from one file system to another.

HyperText Markup Language

The HyperText Markup Language (HTML) is a simple presentation language used to markup the content of Web pages. Its tags often appear in pairs to mark sections of text that should be represented in different colors of fonts.

HyperText Transfer Protocol

The HyperText Transfer Protocol (HTTP) is a set of rules defined to enable a Web client (browser) to interact with a Web server.

Newline

The \n character.

Carriage Return

The \r character. Also used as a synonym for the `Return' or `Enter' key used to terminate a line of text. The name derives from the carriage on a mechanical typewriter.

null character

The \u0000 character. Care should be taken not to confuse this with the null reference.

Multiple Inheritance

The ability of a class or interface to extend more than one class or interface. In Java, multiple inheritance is only available in the following circumstances An interface may extend more than one interface. A class may implement more than one interface. Only single inheritance is possible for a class extending another class.

Polymorphism

The ability of an object reference to be used as if it referred to an object with different forms. Polymorphism in Java results from both class inheritance and interface inheritance. The apparently different forms often result from the static type of the variable in which the reference is stored. Given the following class header class Rectangle extends Polygon implements Comparable an object whose dynamic type is Rectangle can behave as all of the following types: Rectangle, Polygon, Comparable, Object.

Interprocess Communication

The ability of two or more separate processes to communicate with one another.

Reflection

The ability to find out what methods, fields, constructors, and so on, are defined for a class or object. Reflection is supported by the Class class, and other classes in the java.lang.reflect package. Reflection makes it possible, among other things, to create dynamic programs.

Namespace

The area of a program in which particular identifiers are visible. Java uses packages to provide namespaces, and its visibility rules - private, package, protected, public - variously contain identifiers within namespaces.

Address Space

The area of virtual memory in which a process is run.

number base

The base used to interpret numerical characters. Decimal notation is base 10 and binary notation is base 2, for instance.

Method Body

The body of a method: everything inside the outermost block of a method.

Instantiation

The creation of an instance of a class - that is, an object

Object construction

The creation of an object, usually via the new operator. When an object is created, an appropriate constructor from its class is invoked.

Preempt

The currently executing thread may be preempted, or forced to yield control, by a higher priority thread that becomes eligible to run during its timeslice.

Return Type

The declared type of a method, appearing immediately before the method name, such as void in public static void main(String[] args) or Point[] in public Point[] getPoints()

Formal Argument

The definition of a method's argument which are part of a method header. Each formal argument has an associated type. When a method is called, the actual argument values are copied into the corresponding formal arguments. The types of the actual arguments must be compatible with those of the formal arguments.

Dynamic Type

The dynamic type of an object is the name of the class used to construct it. See static type.

Exclusive-or Operator

The exclusive-or operator (^) is both a boolean operator and a bit manipulation operator. The boolean version gives the value true if only one of its operands is true, otherwise it gives the value false. Similarly, the bit manipulation version produces a 1 bit wherever the corresponding bits in its operands are differen

Multiple-boot Options

The hardware configurations of some computers are able to run different operating system and window manager combinations. Some systems allow a user to choose which combination they wish to use during a particular session when the computer is started, or booted.

Method Header

The header of a method, consisting of the method name, its result type, formal arguments and any exceptions thrown. Also known as a method signature.

Left Shift Operator

The left shift operator (<<) is a bit manipulation operator. It moves the bits in its left operand zero or more places to the left, according to the value of its right operand. Zero bits are added to the right of the result.

Member

The members of a class are fields, methods and nested classes.

Public Interface

The members of a class prefixed with the public access modifier. All such members are visible to every class within a program.

Behavior

The methods of a class implement its behavior. A particular object's behavior is a combination of the method definitions of its class and the current state of the object.

Fully Qualified Class Name

The name of a class, including any package name and enclosing class name. Given the following class outline package oddments; class Outer { public class Inner { ... } ... } The fully qualified name of Inner is oddments.Outer.Inner

Dotted Decimal Notation

The notation used to represent the four byte values of an IP address. Each byte is represented as a value between 0 and 255, for instance 129.12.0.1. The most-significant byte is written first.

Key Value

The object used to generate an associated hash code for lookup in an associative data structure.

Operating System

The operating system allows a computer's hardware devices to be accessed by programs. For instance, it allows data to be organized on a computer's disks in the form of a file system and it delivers the co-ordinate positions of a mouse to programs as the mouse is moved. Operating systems also make it possible for multiple programs to be run concurrently, or multiple users to share a single machine. See concurrency.

Assignment Operator

The operator (=) used to store the value of an expression into a variable, for instance: variable = expression; The right-hand-side is completely evaluated before the assignment is made. An assignment may, itself, be used as part of an expression. The following assignment statement stores zero into both variables. x = y = 0;

new Operator

The operator used to create instances {instance} of a class.

Lexicographic Ordering

The ordering of words as they would be found in a dictionary. It should be noted that different locales order similar looking words according to their own conventions - this applies, in particular, to accented characters.

Method

The part of a class definition that implements some of the behavior of objects of the class. The body of the method contains declarations of local variables and statements to implement the behavior. A method receives input via its arguments, if any, and may return a result if it has not been declared as void.

Catch Clause

The part of a try statement responsible for handling a caught exception.

Scheduler

The part of the Java Virtual Machine (JVM) that is responsible for managing threads.

Hardware

The physical devices of a computer system, such as its micro-chips, disk drives, keyboard, printer, sound card, and so on. It is called `hardware' in contrast to programs, which are called `software'.

Information Hiding

The practice of ensuring that only as much information is revealed about the implementation of a class as is strictly required. Hiding unnecessary knowledge of implementation makes it less likely that other classes will rely on that knowledge for their own implementation. This tends to reduce the strength of coupling between classes. It also reduces that chance that a change of the underlying implementation will break another class. Ensuring that all fields of a class are defined as private, is one of the ways that we seek to promote information hiding.

Polling

The process of repeatedly testing until a condition becomes true. Polling can be inefficient if the time between tests is short compared with the time it will take for the condition to become true. A polling thread should sleep between consecutive tests in order to give other threads a chance to run. An alternative approach to polling is to arrange for an interrupt to be sent when the condition is true, or to use the wait and notify mechanism associated with threads.

Assembler

The program used to translate a program written in assembly language into the binary form of a particular instruction set.

Inheritance Hierarchy

The relationship between super classes and sub classes is known as an inheritance hierarchy. Single inheritance of classes means that each class has only a single `parent' class and that the Object class is the ultimate ancestor of all classes - at the top of the hierarchy. Two classes that have the same immediate super class can be thought of as sibling sub classes. Multiple inheritance of interfaces gives the hierarchy a more complex structure than that resulting from simple class inheritance.

Right Shift Operator

The right shift operator (>>) is a bit manipulation operator. It moves the bits in its left operand zero or more places to the right, according to the value of its right operand. The most significant bit from before the shift is replicated in the leftmost position - this is called sign extension. An alternative right shift operator (>>>) replaces the lost bits with zeros at the left.

Precedence rules

The rules that determine the order of evaluation of an expression involving more than one operator. Operators of higher precedence are evaluated before those of lower precedence. For instance, in the expression x+y*z, the multiplication is performed before the addition because * has a higher precedence than -.

Instruction Set

The set of instructions that characterize a particular Central Processing Unit. Programs written in the instruction set of one type of CPU cannot typically be run on any other type of CPU.

Character Set Encoding

The set of values assigned to characters in a character set. Related characters are often grouped with consecutive values, such as the alphabetic characters and digits.

Fetch-execute Cycle

The simple set of steps that are endlessly repeated by a computer's Central Processing Unit for each program instruction: `Fetch the next instruction referenced by the program counter,' `Update the program counter to refer to the next instruction,' `Execute the instruction just fetched.'

Main Method

The starting point for program execution public static void main(String[] args)

Imperative Programming

The style of programming usually associated with languages such as C, Fortran, Pascal and so on. Imperative programming is distinguished from functional programming in that the former is strongly tied to the concept of variables and memory locations. A variable is associated with a memory location and the contents of that memory location may be changed, via the variable, over the course of time. The meaning or effect of a program fragment at a particular point can only be understood by reference to the current contents of the set of relevant variables, therefore. In contrast, functional programs do not allow the contents of a variable to be changed once set (in simplified terms), hence making them easier to reason about. While languages such as C++ and Java are also imperative programming languages, strictly speaking, they are more commonly referred to as object-oriented programming languages.

Exception Handler

The try statement acts as an exception handler - a place where exception objects are caught and dealt with.

Base Type

The type of items which may be stored in an array - the array's defined type. For instance, in int[] numbers; the base type of numbers is int. Where the base type is a class type, it indicates the lowest super type of objects that may be stored in the array. For instance, in Ship[] berths; only instances of the Ship class may be stored in berths. If the base type of an array is Object, instances of any class may be stored in it.

Redundant Value

The value of a data type that has no use or meaning within a particular context. For instance, negative values would be redundant a class using integer attributes to model assignment marks. In some applications, redundant patterns serve a useful purpose in that they can be used explicitly as out-of-bounds values or escape values.

Actual Argument

The value of an argument passed to a method from outside the method. When a method is called, the actual argument values are copied into the corresponding formal arguments. The types of the actual arguments must be compatible with those of the formal arguments.

Return Value

The value of the expression used in a return statement.

Method Result

The value returned from a method via a return statement. The type of the expression in the return statement must match the return type declared in the method header.

Case Label

The value used to select a particular case in a switch statement.

Look-and-feel

The visual impression and interaction style provided by a user interface. This is predominantly the responsibility of the window manager (in collaboration with the underlying operating system) running on a particular computer. It refers to style of such things as window title bars, how windows are moved and resized, how different operations are performed via a mouse, and so on. It is preferable to have a consistent look and feel within a single user environment. However, some window managers do allow individual programs to present a different look and feel from the predominant style of the host environment. Java's Swing components support this idea by allowing an application to select a `pluggable look and feel' from those provided by a user interface manager. An application running in a Microsoft Windows environment could be made to look like one that normally runs in an X Windows environment, for instance. This allows an application to look similar on different platforms, but it can also lead to confusion for users.

Object Serialization

The writing of an object's contents in such a way that its state can be restored, either at a later time, or within a different process. This can be used to store objects between runs of a program, or to transfer objects across a network, for instance.

Data Type

There are eight primitive data types in Java; five of these represent numerical types of varying range and precision - double, float, int, long and short. The remaining three are used to representing single-bit values (boolean), single byte values (byte) and two-byte characters from the ISO Unicode character set (char).

Method Overloading

Two or more methods with the same name defined within a class are said to be overloaded. This applies to both constructors and other methods. Overloading applies through a class hierarchy, so a sub class might overload a method defined in one of its super classes. It is important to distinguish between an overloaded method and an overridden method. Overloaded methods must be distinguishable in some way from each other; either by having different numbers of arguments, or by the types of those arguments being different. Overridden methods have identical formal arguments.

De Morgan's Theorem

Two rules that can help to simplify boolean expressions involving multiple logical-not operators in combination with other boolean operators.

Implicit Type Conversion

Type conversion that does not require a cast. Implicit type conversions typically do not involve any loss of information. For instance, combining an integer operand with a floating point operand in an arithmetic expression will result in an implicit type conversion of the integer to an equivalent floating point value.

Parsing

Usually applied to the action of a compiler in analyzing a program source file for syntax errors. It is also used more widely to mean the analysis of the structure of input.

Field

Variables defined inside a class or interface, outside of the methods. Fields are members of a class.

Message Passing

We characterize object interactions as message passing. A client object sends a message to a server object by invoking a method from the server's class. Arguments may be passed with the message, and a result returned by the server.

Interface Inheritance

When a class implements an interface, an interface inheritance relationship exists between them. The class inherits no implementation from the interface, only method signatures and static variables. It is also possible for one interface to extend one or more interfaces. In Java, interface inheritance is the only form of multiple inheritance. See class inheritance for an alternative form of inheritance.

Boot

When a computer is switched on it is said to `boot up'. This term comes from the phrase, `Pulling yourself up by your bootstraps.' Before a computer is ready to be used, it must load the programs that it needs from its disks, but this means that it must have a program of some sort available in order to be able to load the programs it needs! The loading program is called a bootstrap.

Class Inheritance

When a super class is extended by a sub class, a class inheritance relationship exists between them. The sub class inherits the methods and attributes of its super class. In Java, class inheritance is single inheritance. See interface inheritance for an alternative form of inheritance.

Quotient

When integer division is performed, the result consists of a quotient and a remainder. The quotient represents the integer number of times that the divisor divides into the dividend. For instance, in 5/3, 5 is the dividend and 3 is the divisor. This gives a quotient of 1 and a remainder of 2.

Inner Class

class defined inside an enclosing class or method. We use the term to refer to non-static nested classes.

Graphical User Interface (GUI)

is part of a program that allows user interaction via graphical components, such as menus, buttons, text areas, etc. Interaction often involves use of a mouse.

Bit

A binary digit, which can take on two possible values: 0 and 1. Bits are the fundamental building block of both programs and data. Computers regularly move data around in multiples of eight-bit units (bytes for the sake of efficiency).

Copy Constructor

A constructor taking a single argument of the same class. For instance: public class Point { // Use p's attributes to initialize this object. public Point(Point p){ ... } ... } The argument is used to define the initial values of the new object's attributes.

Concurrency

A feature of parallel programming. Parts of a program whose executions overlap in time are said to execute concurrently. Java's thread feature support concurrency.

Array

A fixed-size object that can hold zero or more items of the array's declared type.

Cascading if-else statement

A form of if-else statement in which each else-part (except the last) consists of a further nested if-else statement. Used to overcome the problem of textual drift often associated with nested if statements.

Accessor Method

A method specifically designed to provide access to a private attribute of a class. By convention, we name accessors with a get prefix followed by the name of the attribute being accessed. For instance, the accessor for an attribute named speed would be getSpeed. By making an attribute private, we prevent objects of other classes from altering its value other than through a mutator method. Accessors are used both to grant safe access to the value of a private attribute and to protect attributes from inspection by objects of other classes. The latter goal is achieved by choosing an appropriate visibility for the accessor.

Abstract Method

A method with the abstract reserved word in its header. An abstract method has no method body. Methods defined in an interface are always abstract. The body of an abstract method must be defined in a sub class of an abstract class, or the body of a class implementing an interface.

Datagram

A packet of information passed between two communicating processes across a network. Both the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP) are indirectly involved in sending datagrams to provide reliable or unreliable communication, respectively.

Complier

A program which performs a process of compilation on a program written in a high level programming language.

Class

A programming language concept that allows data and methods to be grouped together. The class concept is fundamental to the notion of an object-oriented programming language. The methods of a class define the set of permitted operations on the class's data (its attributes). This close tie between data and operations means that an instance of a class - an object - is responsible for responding to messages received via its defining class's methods.

Aggregation

A relationship in which an object contains one or more other subordinate objects as part of its state. The subordinate objects typically have no independent existence separate from their containing object. When the containing object has no further useful existence, neither do the subordinate objects. For instance, a gas station object might contain several pump objects. These pumps will only exist as long as the station does. Aggregation is also referred to as the has-a relationship, to distinguish it from the is-a relationship, which refers to inheritance.

Binary Search

A search of sorted data, in which the middle position is examined first. Search continues with either the left or the right portion of the data, thus eliminating half the remaining search space. This process is repeated at each step, until either the required item is found, or there is no more data to search.

Critical Section

A section of code in which there is potential for a race hazard. Critical sections make use of the synchronized methods or statements.

Abstraction

A simplified representation of something that is potentially quite complex. It is often not necessary to know the exact details of how something works, is represented or is implemented, because we can still make use of it in its simplified form. Object-oriented design often involves finding the right level of abstraction at which to work when modeling real-life objects. If the level is too high, then not enough detail will be captured. If the level is too low, then a program could be more complex and difficult to create and understand than it needs to be.

Break Statement

A statement used to break out of a loop, switch statement or labeled block. In all cases, control continues with the statement immediately following the containing block.

Cursor

A visual representation of the current position of the mouse on the user's virtual desktop. Cursor shapes are often set to represent the current state of a program - using an hour glass shape to indicate that the user should wait - or to suggest the actions that are possible by clicking the mouse over some part of a user interface.

Anonymous Array

An array created without an identifier. An anonymous array is usually created as an actual argument, for instance: // Create an anonymous array of integers. YearlyRainfall y2k = new YearlyRainfall( new int[]{ 10,10,8,8,6,4,4,0,4,4,7,10,}); An anonymous array may also be returned as a method result.

Connection Handshake

An exchange of messages between two processes in an attempt to establish a connection between them.

Arithmetic Expression

An expression involving numerical values of integer or floating point types. For instance, operators such as +, -, *, / and % take arithmetic expressions as their operands and produce arithmetic values as their results.

Boolean Expression

An expression whose result is of type boolean, i.e. gives a value of either true or false. Operators such as && and || take boolean operands and produce a boolean result. The relational operators take operands different types and produce boolean results.

Array initializer

An initializer for an array. The initializer takes the place of separate creation and initialization steps. For instance, the initializer int[] pair = { 4, 2, }; is equivalent to the following four statements. int[] pair; pair = new int[2]; pair[0] = 4; pair[1] = 2;

Anonymous Object

An object created without an identifier. They are usually created as array elements, actual arguments or method results. For instance: private Point[] vertices = { new Point(0,0), new Point(0,1), new Point(1,1), new Point(1,0), }; See anonymous class, as these often result in the creation of anonymous objects.

Decrement Operator

An operator (--) that adds one to its operand. It has two forms: pre-decrement (--x) and post-decrement (x--). In its pre-decrement form, the result of the expression is the value of its argument after the decrement. In its post-decrement form, the result is the value of its argument before the decrement is performed. After the following, int a = 5, b = 5; int y,z; y = --a; z = b-- y has the value 4 and z has the value 5. Both a and b have the value 4.

Command-line Argument

Arguments passed to a program when it is run. A Java program receives these in the single formal argument to its main method public static void main(String[] args) The arguments are stored as individual strings.

Bootstrap Classes

Classes that make up the Java Platform Core Application Programming Interface (API), such as those found in the java.lang, java.io and java.io packages.

Coupling

Coupling arises when classes are aware of each of other because their instances must interact. Linkage between two classes that may be either strong or weak. Stronger coupling arises when one class has a detailed knowledge of the internal implementation of another, and is written to take advantage of that knowledge. So anything that has the potential to reduce the amount of inside knowledge will tend to weaken coupling. Hence, information hiding and encapsulation. Java's visibility levels - private, package, protected, public - progressively reveal detail to other classes, and so increase the potential for stronger coupling. Interfaces are one way to reduce to reduce coupling - because you interact with a class via an abstract definition, rather than a concrete implementation.

Arithmetic Operator

Operators, such as +, -, *, / and %, that produce a numerical result, as part of an arithmetic expression.

Byte

In general computing, this refers to eight bits of data. In Java it is also the name of one of the primitive data types, who size is eight bits.

Bit Manipulation Operator

Operators, such as &, | and ^, that are used to examine an manipulate individual bits within the bytes of a data item. The shift operators, <<, >> and >>>, are also bit manipulation operators.

Bounded Repetition

Repetition where the statements within a loop's body are performed a fixed number of times and the number of times is established when the loop is started. There is no control structure in Java that guarantees bounded repetition.

Branch Instruction

Stores a new instruction address into the program counter. The effect of this is the next instruction to be fetched will not usually be the one immediately following the branch instruction. Hence the normal sequential execution of instructions is disrupted. This allows both repetition and conditional execution of instructions to be effected.

Central Processing Unit

The Central Processing Unit (CPU) is the heart of a computer as it is the part that contains the computer's ability to obey instructions. Each type of CPU has its own instruction set.

Compliment Operator

The complement operator, ~, is used to invert the value of each bit in a binary pattern. For instance, the complement of 1010010 is 0101101.

Default Initial Value

The default value of any variable not explicitly initialized when it is declared. Fields of numeric primitive types have the value zero by default, boolean variables have the value false, char variables have the value \u0000 and object references have the value null. The initial values of local variables are undefined, unless explicitly initialized.

Default Label

The destination for all values used in a switch statement expression that do not have explicit case labels. A default label is optional.

Cohesion

The extent to which a component performs a single well-defined task. A strongly cohesive method, for instance, will perform a single task, such as adding an item to a data structure, or sorting some data, whereas a weakly cohesive method will be responsible for several disparate tasks. Weakly cohesive components should, in general, be split into separate more cohesive components. The java.util package is a weakly cohesive package because it contains many unrelated classes and interfaces, whereas the java.io package is highly cohesive.

Class Header

The header of a class definition. The header gives a name to the class and defines its access. It also describes whether the class extends a super class or implements any interfaces.

Bounds

The limits of an array or collection. In Java, the lower limit is always zero. In the case of an array, the upper bound is one less than then length of the array, and is fixed. Indexing outside the bounds of an array or collection will result in an IndexOutOfBoundsException exception being thrown.

Cast

Where Java does not permit the use of a source value of one type, it is necessary to use a cast to force the compiler to accept the use for the target type. Care should be taken with casting values of primitive types, because this often involves loss of information. Casts on object references are checked at runtime for legality. A ClassCastException exception will be thrown for illegal ones.

Common Gateway Interface (CGI)

a standard that allows Web clients to interact with programs on a Web server. A CGI script on the server is able to process input or arguments from a client, and respond accordingly.


Ensembles d'études connexes

Pectoral Region Muscles: Origin, Insertion, Innervation and Action

View Set

AP Psych Unit 4 Test Bank Question (Set 1)

View Set

3.1 How the Physical World Relates to the Psychological World

View Set

Perioperative Nursing Management

View Set

Endocrine Disorders Concept: Fluid and Electrolytes

View Set

AP Euro - Test 1 Abbreviated Version

View Set

PSY1010 Chap. 6 REVIEW QUESTIONS

View Set

Chapter 10- Interest Groups- (American Federal Government)

View Set

Absolutism/Constitutionalism Test Q?'s

View Set