Flashcards in glossary Deck (86)
A class that deﬁnes acommonmessage protocol andcommonset of instance variables fori ts subclasses. In Javaanabstract classcannot be instantiated.
The scope foraccess that exists for a softwarecomponent such as amethod. There are four access levels in Java: public, private, protected and default. The default level occurs whennoaccess modiﬁer is speciﬁed
Oneofthree Java keywords (public, private, protected)which specify thev isibility of variables andmethods.
An actual argument is a value used in a message that is copied to a formal argument for use inside the corresponding method. Actual arguments must be of a compatible type with their corresponding formal arguments. They are sent to a method or constructor e.g. add(no1,no2)
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.
An indexable, fixed-size collection whose elements are all of the same type.
An expression that can be used to initialise an array using assignment, a shortcut way of initialising array elements.
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.
assign See assignment.
the process that results in the variable on the left-hand side of the assignment operator receiving a copy of the value on the right-hand side of the assignment operator. The value may be a primitive value or a reference to an object. If the right-hand side of the assignment operator is an expression, it is evaluated first.
An operator (=) used to assign a value to a variable in an assignment statement.
Some property or characteristic of an object that can be accessed using a getter method. Attributes are generally implemented by instance variables. Examples of such attributes are position and colour for Frog objects, and balance and holder for Account objects.
This is the automatic process of wrapping primitive values when called for by the context of usage in a Java program.
This is the automatic process of unwrapping primitive values when called for by the context of usage in a Java program.
A data structure that can contain zero or more unsorted elements. A HashSet uses buckets to implement a set. The hash code of each incoming element is used to decide which bucket to store it in.
Could refer to either an area used for temporary storage as data is transferred between a data source and a data sink, or a sequence of unfilled components that allows a StringBuilder object to grow.
The cause of a run-time error.
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 xxxed, meaning that when an object is created, the constructors of all its superclasses are also called, either explicitly or implicitly.
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.checked at compile time ioexception
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 variable declared with the keyword static. 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.
consists of a number of, possibly zero, objects (strictly object references) or primitives. The objects or primitives within a collection are referred to as elements.
A set of library classes used to create various kinds of collection such as tree structures and queues. When capitalised, this phrase usually refers to classes that are part of Java’s Collections Framework, which excludes array types. When used in lower case, the same phrase generally means any class that implements a collection (in the looser English language sense), which includes array types.
Framework includes a set of collection interfaces (Collection, Set, List, Map, and others), a set of collection classes (e.g. HashSet and HashMap) that implement them, and some supporting utility classes (e.g. Collections).
common message protocol
A set of messages shared by a number of classes.
An interface that allows an element type to be sorted. It contains a single method: compareTo().
The sole method of the Comparable interface. Allows classes of objects implementing this interface to be sorted (i.e. gives them a natural ordering).
comparison operators A set of operators used for comparing values of expressions, including ==, > and < .