Bookmark and Share

Front Back
abstract class
A class that defines a common message protocol and common set of instance variables for its subclasses. In Java an abstract class cannot be instantiated.
abstract method
A method declared as abstract. Abstract methods have no bodies. They must be implemented in any concrete subclasses of the class in which they are specified. Interfaces also specify abstract methods which must be implemented by classes implementing the interface.
access level
The scope for access that exists for a software component such as a method. There are four access levels in Java: public private protected and default. The default level occurs when no access modifier is specified.
access modifier
One of three Java keywords (public private protected) which specify the visibility of variables and methods.
See visibility.
An annotation is a piece of code in a source file that indicates a programmer’s intention to the compiler. The only annotation we use in M250 is @Override. All annotations begin with the character @ in Java.
The keyword in a Java assertion statement used to indicate a condition that should be true in order for the code to be correct particularly used in private methods.
A statement in the Java language that enables you to test your assumptions about your program a condition that a programmer believes should be true.
The cause of a run-time error.
call stack
A representation of the order of methods called at some point during the execution of a program shown as a stack of method names with the first called method on the bottom and the last called method on the top.
The process of catching an exception and the keyword introducing the clause in a try-catch statement that handles an exception.
Constructors are said to be chained meaning that when an object is created the constructors of all its superclasses are also called either explicitly or implicitly.
checked exception
An exception that the compiler requires the programmer to explicitly handle or declare may be thrown in a method header using a throws clause. These exceptions are ones that a programmer may reasonably be expected to catch or should be made aware of.
class header
The line in a class definition which gives its access modifier name and optionally the name of a class it extends and the name(s) of any interface(s) it implements. Example usage: public class WeatherFrog extends Frog implements WeatherClient
class method
A class method is a method declared with the keyword static and is associated with a class rather than with any of its instances. Classes are not objects so code in a class method cannot use the expression this or the keyword super. Class methods are invoked directly on the name of the class using static binding and so do not exhibit polymorphism.
class variable
A class variable is a variable declared with the keyword static. A class variable is associated with a class rather than with any of its instances although each instance of a class can access its own class’s class variables. A class only ever has one copy of each of its class variables. See qualified for details of how class variables are accessed.
client (class)
In programming an object that uses a service provided by some other (server) class.
The achievement of a software solution using two or more communicating objects.
common message protocol
A set of messages shared by a number of classes. Often used to describe the set of messages specified by an abstract class for its concrete subclasses.
compilation error
An error detected by a compiler when code is compiled (which is known as compile-time). No bytecode is generated if there are compilation errors.
Software which checks that text written in a high-level language is correctly formed and as far as can be determined before compilation that it is meaningful source code for the language.
compile-time error
See compilation error.
concrete class
A class which is not abstract a class for which instances can be created.
A constant is a variable whose value is fixed and unchangeable. Normally the keyword final is used to make a value into a constant. In addition where only a single value is needed for a class constants are typically declared as static. However static is not always used for constants as sometimes a situation needs to be modelled where each instance of a class has its own different constant value such as a serial number.
constant instance variable
Constants are usually declared as final static variables. However sometimes it makes more sense to define a constant as a final instance variable. See constant for more information.
constructor chaining
The process whereby constructors use super() to invoke constructors higher up their inheritance hierarchy.
data field
A term encompassing instance variables and class variables as well as constants.
See design by contract.
The identification and removal of errors (bugs) from a program.
default constructor
A zero-argument constructor that simply invokes super(). This constructor is provided automatically by the compiler when the programmer has not specified any constructor in a class.
default values
The values used by default to initialise instance variables of a class which may be overwritten by another explicit initialisation.
defensive programming
A programming technique in which a method provides alternative paths to deal with expected and unexpected arguments. The method may return a Boolean to indicate success or failure or (when necessary) use an exception to signal a failure.
design by contract (DbC)
A programming technique in which a specification states a precondition for the correct use of a method and a postcondition that the method will achieve in the event that its precondition is met. An exception is thrown by a method when its precondition is not met.
design principle
In contrast to a guideline or suggestion the word principle is reserved for recommendations that apply universally or nearly universally. In this module the term design principle is applied to principles governing how code should be organised. The authors reserve the right sometimes to violate design principles for teaching reasons!
direct interaction
Direct interaction is not a formal technical term but a descriptive phrase used to describe a situation where one object has a reference to another and this reference is used to affect the state or behaviour of the other object. Contrast with indirect interaction.
direct subclass
A class is a direct subclass of another class if it is directly below that class in the class hierarchy.
direct superclass
A class is a direct superclass of another class if it is directly above that class in the class hierarchy. In Java the keyword extends is used by a subclass to indicate its direct superclass.
dynamic binding
The postponing of what method to select for execution in response to a message until run-time. The method selected depends on the class of object that receives the corresponding message rather than on the type of the variable that references it.
An object that is thrown by a method or the JVM as the result of a run-time error. The exception object holds details of what went wrong allowing the exception handler that catches the exception to take appropriate action or provide a useful error message to the programmer.
exception handler
A block of code written to deal with (handle) an error that has been signalled within some program code. In Java the error must have arisen in the context of a try block and the exception handler is in an associated catch block. The try and catch together make up a single statement.
exception handling
The programmed catching of an exception and the subsequent execution of code to abandon or continue execution or to restore the software to a meaningful state.
failing fast
The programming philosophy which recommends that errors be signalled as soon as possible so that their cause can be more easily traced and so that errors are not allowed to be passed on to other parts of a software system potentially causing problems later. In Java this is done by throwing an exception.
See data field.
The keyword final prevents a variable from ever having its value reassigned once it has an initial value.
formatting guidelines
A set of guidelines which specify how program code should be laid out.
See exception handler.
The situation in which a superclass member is not directly accessible in a subclass due to the subclass defining a member with the same name (for a variable) or same signature (for a method).
In software development to write the program code for some task or specification. We also say that a class implements an interface when it implements the interface and is able to understand all the messages specified by the method signatures of the interface.
A keyword in Java used in a class header to specify that the class implements a particular interface. Example usage: public class SomeClass implements SomeInterface
indirect interaction
Indirect interaction is not a formal technical term but a descriptive phrase used to describe a situation where one object affects the state or behaviour of the other object but without actually having a reference to that object – i.e. some intermediary object is used. Contrast with direct interaction.
x of y cards Next >|