Glossary Flashcards

1
Q

wrapping

A

The process of converting a primitive value to an object equivalent, using a wrapper class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

state

A

The values of the attributes of an object constitute its state. The state of an object can vary over time as the values of its attributes change.

A behaviour of an object in response to a message may be dependent on its state.
Example: sending an HoverFrog instance the message upBy()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

message

A

A message is a request for an object to do something. The only way to make an object do something is to send it a message. For example, the position of a Frog object changes when it is sent the message left() or right(); to obtain information on the value of a Frog object’s colour attribute, you send it the message getColour().

A message must be in the protocol of the receiver.

May return a message answer and/or change the state of the receiver

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

protocol

A

The set of messages an object understands.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

public protocol

A

The part of the protocol of a class or object that is accessible from outside of the class itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

private protocol

A

The part of the protocol of a class or object that is inaccessible from a context outside of the class itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

message answer

A

When a message is sent to an object, then, depending on what the message is, a message answer may be returned. A message answer is a value or an object; it is not a message. Sometimes a message answer is used, sometimes it is ignored. A message answer may be used subsequently as the receiver or argument of another message. Getter messages return the value of an attribute, as with the message getColour(), which returns a value such as OUColour.GREEN.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

message expression

A

A message-send that evaluates to some value, i.e. the message returns a message answer. We also say that it returns a value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

message name

A

The name of a message, including the following parentheses, but excluding any arguments. For example, the name of the message left() is left(), and the name of the message upBy(6) is upBy().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

message-send

A

The code that sends a message to an object – for example, frog1.right(), which consists of the receiver followed by a full stop and then the message.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

collaboration

A

The achievement of a software solution using two or more communicating objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

receiver

A

The object to which a message is sent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

class

A

A class is like a blueprint for the creation of objects and ensures that all its instances have the same instance variables and behave in response to messages in an identical manner.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

class header

A
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

class method

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

class variable

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

qualified

A

The qualified name of a member is its simple name prefixed by the name of its enclosing class, as in OUDialog.request. The parts of such names are separated by dots. This means that different classes can have members with the same names – the qualified names allow them to be distinguished from one another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

superclass

A

If B is a subclass of A, then A is the superclass of B. In the Java programming language a subclass has only one direct superclass.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

subclass

A

A subclass is any class which extends (inherits from) another class. In Java all classes except Object are subclasses of some other class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

subclassing

A

Defining a class as a subclass of an existing class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

instance

A

An object that belongs to a given class is described as an instance of that class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

instance method

A

Code that is executed as the result of a message being sent to an object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

instance variable

A

A variable whose identifier and type is common to all the instances of a class, but whose value is specific to each instance. Each instance variable either contains a reference to an object or contains a value of some primitive type. For example, Frog objects have the instance variables colour and position. The values of the instance variables of a particular object represent the state of that object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

invocation

A

Executing code in a method. Class (static) methods are invoked directly on a class, whereas instance methods are invoked by sending messages to objects. Also called method invocation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

getter message

A

A message that returns as its message answer the value of one of the receiver’s attributes. See also setter message.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

getter method

A

A method whose purpose is to return the value of one of an object’s attributes as its message answer. For example, the method getPosition() is a getter method that returns the value of the instance variable position held by instances of the Frog class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

behaviour

A

A term used to describe the way in which an object behaves in response to the messages in its protocol.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

primitive data type

A

A set of values together with operations that can be performed on them. The primitive data types in Java provide a set of basic building blocks from which all of the more complex types of data can be built. Java’s primitive data types include int, char and boolean.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

primitive type variable

A

A variable declared to hold a value of the declared or compatible primitive data type. Less formally we refer to a primitive variable.

int counter; // declaration
counter = 0; // initialisation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

primitive value

A

A value of some primitive type; for example, true, -1.3, 42, or ‘x’ are all primitive values of different primitive types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Integer types

A

byte - 8 bits
short - 16 bits
int - 32 bits
long - 64 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

declaration statement

A

Reserves memory for a variable of some type.

int myNumber;
String myString;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

reference type variable

A

A variable declared to hold a reference to an object of the declared type (or a compatible type). Less formally we refer to a reference variable.

Frog kermit; // declaration
kermit = new Frog(); // initialisation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

null

A

built-in literal

Can be assigned to reference variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

constructor

A

A programming construct, similar to a method, used to initialise a newly created object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

constructor chaining

A

The process whereby constructors use super() to invoke constructors higher up their inheritance hierarchy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

declaration

A

A statement in which memory is reserved for a variable of some type that is formed by writing the type of the variable followed by some name (its identifier).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

garbage collection

A

The process of destroying objects that have become unreachable because they are no longer referenced by variables, in order to reclaim their space in memory. In certain programming languages, including Java, this process is automatic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

keyword

A

A Java keyword is a word reserved for use in the language. Keywords cannot be used as variable identifiers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

evaluate

A

To find the value of something. We say that expressions have a value or evaluate to some value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

expression

A

Code that evaluates to a single value. Expressions can be formed from literals, variables, operators and messages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

literal

A

A textual representation of a primitive value or object. For example, ‘X’ is a char literal, 4.237 is a double literal and “hello there!” is a String literal.

43
Q

operator

A

A symbol used as a function, that is, it has one or more values it operates on and returns a value.

Unary operator:
only one operand i.e. -(-7)

44
Q

precedence rules

A

Rules for determining the order in which various operators are evaluated in a complex expression.

45
Q

compound expression

A

An expression built up using other sub-expressions, for example, the following is a compound expression: (3 + 2) * (6 - 3).

46
Q

string

A

A sequence of characters (sequence = in a particular order )enclosed in quotation marks; an object of type String.

47
Q

string interning

A

A process used by Java to create a pool of strings that can be reused when possible, which may result in the sharing of string literals.

48
Q

concatenation

A

The joining of two strings. In Java the string concatenation operator is + (the plus sign). For example, “Milton “ + “Keynes” evaluates to “Milton Keynes”.

“Hallo” + 4 evaluates to “Hallo4”

49
Q

Char

A

primitive type
can be represented by an unsigned integer
you can add 1 to get the next character in a character set

50
Q

toString()

A
returns textual representation of an object
defaults to class and memoryadress
51
Q

type

A

A type is a set of values and set of operations that are permitted on those values. Java has tow different kind of types - primitive data types and reference types.

52
Q

variable

A
  • Named memory location

* Must follow the rules for Java identifiers

53
Q

method body

A

That part of a method enclosed by braces that follows the method header. The body of a method is an example of a statement block.

54
Q

method header

A
A method header consists of an access modifier (e.g. public), a return value (e.g. int or void) and a name (e.g. setPosition) followed by any
formal argument names enclosed in parentheses (e.g. (int aNumber)). For example, the method header for the method of the class Frog whose name is setPosition() is public void setPosition(int aNumber).
55
Q

method

A

The code that is invoked by the Java Virtual Machine at run-time when an object receives a message.

56
Q

method signature

A

The name of the method together with the parentheses and the types of any arguments. For example, the signature for the setPosition() method in the Frog class is setPosition(int).

getPosition();
getColour(OUColour);

57
Q

actual argument

A

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.

58
Q

formal argument

A

A typed identifier used in a method signature between parentheses to stand for a value (an actual argument) that is passed into the method body by a message.

public void myMethod (String formalArgument){}

59
Q

overloading

A

A method is said to be overloaded when there are other methods, defined in the same class, or inherited (in the JLS sense) from some superclass, with the same name but a different method signature, i.e. different types and/or numbers of arguments.

60
Q

overriding

A

The process of redefining (replacing) a method that would have been inherited (JLS definition) from a superclass so as to cause it to have different behaviour. A method that overrides a method from a superclass has the same signature and return type as the superclass method.

61
Q

@Override

A

A Java annotation used to indicate that a method is intended to override an inherited method.

62
Q

member

A
Members of a class: class variables, class methods, instance variables
and instance methods. Constructors are not members. Members are involved in inheritance.
63
Q

local variables

A

A variable that is declared inside a statement block, such as inside a method body, or for statement. The scope of such a variable is restricted to the statement block in which it is declared

64
Q

lazy evaluation

A

A type of evaluation used in compound Boolean expressions involving the && and || operators whereby the second operand is evaluated only when it is necessary to do so in order to determine the truth value of the whole expression.

65
Q

interpreter

A

A program that translates statements (rather than translating a whole program) from a high-level language, such as Java, to a machine code language, and executes the machine code.

66
Q

interface

A

An interface specifies a list of messages that a group of UNRELATED classes, which are said to implement the interface, must be able to receive.

An interface lists only method headers (no method code), cannot declare any instance variables and cannot be instantiated.

Classes implementing an interface must be able to receive all the messages corresponding to methods specified by that interface, either by defining the required methods or inheriting them.

67
Q

wrapper class

A

Every primitive type has a corresponding wrapper class whose purpose is to hold a primitive value in a place where a primitive value is intuitively what is needed, but where the type checking requires an object. For example, the wrapper class of int is Integer. Wrapper classes are used in auto-boxing.

68
Q

void

A

A keyword used in Java to indicate that a method does not return a value.

69
Q

virtual machine (VM)

A

A layer of software that simulates a computer capable of interpreting bytecode.

70
Q

unwrapping

A

The process of converting a wrapped value (one contained in a wrapper class) to its primitive value equivalent.

71
Q

unchecked exception

A

An exception for which the compiler does not require any explicit exception handling code and that the compiler does not require the programmer to declare as thrown in a method header. These are errors that may not be easily recovered from, or should not be recovered from; instead, program logic or other issues may need to be resolved.

72
Q

tree

A

A collection structure typified by branching connections between elements, often used to create collections of items sorted according to some criteria.

73
Q

token

A

An item of data that can be written to or retrieved from a file. Delimiters are used to separate tokens in a file.

74
Q

try-catch statement

A

An exception handling statement, a mechanism to catch exceptions. If a possible checked exception is not declared in a throws clause, it must be handled using a try-catch statement.

75
Q

throws clause

A

A part of a method header beginning with the keyword throws, followed by a comma-separated list of any exceptions the programmer wants to declare to be thrown. If a checked exception is not handled, it must be declared in a throws clause.

76
Q

supertype

A

A type that supports substitution of more specific types. Both interface types and superclass types (including abstract class types) are examples of supertypes. See also subtype.

77
Q

syntax

A

The syntax of a programming language is the set of rules governing the structure of the language, including its valid symbols, expressions and structures. Syntax rules define the form of the various constructs in the language, but say nothing about the meaning of these constructs.

78
Q

substitution

A

The technique of providing an instance of one class in a situation where an instance of a different class is expected. In Java, an object can be assigned to a variable whose type has been declared as some superclass of the object, or which has been declared as an interface type which that object’s class implements. Similarly, an object can be used as an actual argument to a method where the formal argument’s type has been declared as some superclass of the object, or which has been declared as an interface type which that object’s class implements.

79
Q

strong typing

A

A programming language feature that requires variables to have a declared type and enforces rules on the ways in which those types can be used, including what types of values can be assigned to variables of those types and what operators values of those types can be used with. Languages (such as Java) that feature strong typing are said to be strongly typed.

80
Q

static

A

A Java keyword that defines a variable or method as belonging to a class rather than its instances.

81
Q

statement

A

A statement represents a single instruction for the compiler to translate into bytecode. In Java most statements end with a semicolon.

82
Q

stack trace

A

A stack of textual information ordered from the last thing that happened down to the first thing that happened that is displayed when an exception is thrown and not handled; a representation of a call stack.

83
Q

stable sort

A

A sort that does not reorder equal elements.

84
Q

sorted collection

A

A collection that always keeps its elements in their natural ordering, if any. This contrasts with an ordered collection, where the ordering may just be an accident of where elements happen to have been placed in the collection.

85
Q

setter method

A

A method whose purpose is to assign a new value to an instance variable. For example, the method setPosition() is a setter method for the instance variable position held by instances of the Frog class.

86
Q

set

A

A collection in which each item may appear only once – no duplicates are allowed.

87
Q

secondary sort

A

A sorting that can be applied after applying a primary sort in order to sort any elements that are considered equal by the primary sort.

88
Q

scope

A

The scope of a variable describes the areas of program code from which the variable may be used. The scope of a local variable is from the point where it is declared to the end of its enclosing statement bloc

89
Q

run-time error

A

A programming error that becomes apparent only when the program is run, and has not been detected beforehand. Run-time errors can be caused by logical errors, failure to account for different ways in which code might be used, or conditions outside of the control of the programmer.

90
Q

refactoring

A

Refactoring is when code is rewritten without changing its overall effect, but for the purpose of improving its design, removing code duplication, or improving maintainability.

91
Q

protected

A

Java access modifier used to restrict access of a member of a class X to subclasses of X and classes within the same package as class X.

92
Q

public

A

An access modifier applied to a class member that allows all classes of objects to have access.

93
Q

private

A

An access modifier that restricts access to a class member to objects of the class to which it belongs.

94
Q

orchestrating instance

A

An orchestrating instance is a separate object used to tie together the different parts of a complicated interaction that do not seem to belong to any single one of the objects involved.

95
Q

ordered collection

A

A collection where each element in the collection has a well-defined place, as indicated by its index number. Thus, an ordered collection allows us to access and find the first, second or last element etc. However, the order does not have to reflect anything to do with the elements themselves. It is simply determined by where each element has been placed in the list. This contrasts with a sorted collection

96
Q

natural ordering

A

In Java, an element type is said to have a natural ordering if it implements the interface Comparable and consequently has a compareTo()method. For numbers and strings, the natural ordering corresponds simply to everyday numerical order and alphabetical order.

97
Q

map

A

A collection type that relates a set of keys to their corresponding values.

98
Q

hiding

A

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).

99
Q

hash code

A

In Java, a hash code is an int that can be calculated for any object, by sending it the message hashCode(). This method is inherited from Object, but in general must be overridden if equals() has been overridden. Hash codes are used by sets and related collections to allow them to store elements efficiently and to check rapidly for duplicates. If a class redefines equals(), then the hashCode() method for that class must take the definition into account; otherwise the type will not behave properly in collections.

100
Q

flushing

A

The process of emptying a buffer so that no data remains in it, the data being transferred to a sink.

101
Q

wrapper class

A
  • every primitive type has one
  • used where type checking requires an object (e.g. Collections)
  • wrapper class of int is Integer
102
Q

visibiity

A

refers to whether or not parts of a class can access that item directly

103
Q

union

A

Results in a set containing all of the elements of all of the sets. The term is used to refer both to the result and to the operation.

104
Q

this()

A

used to invoke another constructor in the same class