glossary Flashcards

1
Q

abstract class

A

A class that defines acommonmessage protocol andcommonset of instance variables fori ts subclasses. In Javaanabstract classcannot be instantiated.

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

access level

A

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 modifier is specified

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

access modifier

A

Oneofthree Java keywords (public, private, protected)which specify thev isibility of variables andmethods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
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. They are sent to a method or constructor e.g. add(no1,no2)

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

annotation

A

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.

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

array

A

An indexable, fixed-size collection whose elements are all of the same type.

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

array initialiser

A

An expression that can be used to initialise an array using assignment, a shortcut way of initialising array elements.

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

assert

A

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.

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

assertion

A

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.

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

assignment

A

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.

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

assignment operator

A

An operator (=) used to assign a value to a variable in an assignment statement.

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

attribute

A

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.

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

auto-boxing

A

This is the automatic process of wrapping primitive values when called for by the context of usage in a Java program.

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

auto-unboxing

A

This is the automatic process of unwrapping primitive values when called for by the context of usage in a Java program.

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

bucket

A

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.

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

buffer

A

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.

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

bug

A

The cause of a run-time error.

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

call stack

A

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.

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

catch

A

The process of catching an exception, and the keyword introducing the clause in a try-catch statement that handles an exception.

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

chaining

A

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.

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

checked exception

A

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

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

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 class method

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

class variable

A

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.

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

collection

A

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.

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

Collection Class

A

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.

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

Collections Framework

A

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

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

common message protocol

A

A set of messages shared by a number of classes.

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

Comparable

A

An interface that allows an element type to be sorted. It contains a single method: compareTo().

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

compareTo()

A

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

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

compilation error

A

An error detected by a compiler when code is compiled (which is known as compile-time). No bytecode is generated if there are

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

compiler

A

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.

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

component type

A

The type of the components of an array object; this determines the types of the object or primitive value that can be stored in the array.

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

concrete class

A

A class which is not abstract; a class for which instances can be created.

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

constant instance variable

A

are usually declared as final static variables. However, sometimes it makes more sense to define a constant as a final instance variable.

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.

36
Q

constructor chaining

A

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

37
Q

data hiding

A

The use of access modifiers to restrict access to class members, particularly instance variables, so that an object becomes a ‘black box

38
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

39
Q

default constructor

A

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.

40
Q

defensive programming

A

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.

41
Q

delimiter

A

A character used to mark where some part of a program starts or ends. For example, in Java, the character ; marks the end of a statement and the character { marks the beginning of a statement block.

42
Q

design by contract (DbC)

A

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.

43
Q

destructive operation

A

An operation on a collection that changes the contents of the collection in some way is said to be destructive. You may need to examine the Java API to determine whether a method is destructive or non-destructive.

44
Q

dynamic binding

A

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.

45
Q

effective length

A

The number of meaningful elements that a fixed-size collection actually holds.

46
Q

encapsulation

A

the parcelling up of information and behaviour into a reusable component. incorporating into a single entity (the object) both the data (instance variables) and the behaviour (methods) defined for that data.

47
Q

equals()

A

A method that determines whether two objects are equal or not. Since it is implemented by the class Object, all classes of object understand the message equals(), but the method is overridden to define versions of equality appropriate to particular classes. For many classes, such as String, the method equals() is defined effectively to mean ‘has the same state as’.

48
Q

exception

A

An object that is thrown by a method or the JVM as the result of a run-time error

49
Q

failing fast

A

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.

50
Q

final

A

prevents a variable from ever having its value reassigned once it has an initial value

51
Q

finally

A

introduces a block of code in a try-catch statement that will always be executed, regardless of whether an exception occurs or not.

52
Q

final

A

prevents a variable from ever having its value reassigned once it has an initial value.

53
Q

floating point

A

A type capable of representing a decimal number (to a restricted level of accuracy).

54
Q

flushing

A

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

55
Q

formal argument

A

A typed identifier used in a method signature between parentheses to stand for a valuethat is passed into the method body by a message.

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

57
Q

helper method

A

A method whose purpose is to do some internal work of an object and which therefore should have private access so that it cannot be used by objects of other classes.

58
Q

homogeneous collection

A

A collection in which all the elements are of the same type

59
Q

implements

A

A keyword in Java used in a class header to specify that the class implements a particular interface

60
Q

indirect subclass

A

if it inherits from that class via one or more intermediate classes.

61
Q

indirect superclass

A

if it is above that class in the class hierarchy but not directly above it.

62
Q

inheritance

A

A relationship between classes by which they are organised into a hierarchy. According to the Java Language Specification (JLS), classes lower in a hierarchy are said to inherit all the accessible members from classes higher in the hierarchy, other than those they override or hide. However, in general object-oriented terms, an object of class T is said to inherit all the members of the superclasses of T.

63
Q

instance method

A

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

64
Q

intersection

A

a mathematical operation on two or more sets that results in a set containing only the elements common to both sets. The term is used to refer both to the result and to the operation.

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

66
Q

map

A

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

67
Q

message

A

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 left()

68
Q

overloading

A

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.

69
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.
70
Q

polymorphic method

A

A method with the same signature as some other method, but which typically defines different behaviour. For example the method home() defines different behaviour for Frog, Toad and HoverFrog objects

71
Q

postcondition

A

A condition that is true after some code (particularly a method) is executed.

72
Q

precondition

A

A condition that must be true before some code is executed in order for that code to behave correctly. The user of a method typically checks its precondition before using it.

73
Q

private

A

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

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

75
Q

protocol

A

The set of messages an object understands.

76
Q

reference type variable

A

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

77
Q

run-time error

A

A programming error that becomes apparent only when the program is run

78
Q

Scanner

A

A class used to read string tokens from a source

79
Q

scope

A

describes the areas of program code from which the variable may be used.

80
Q

static

A

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

81
Q

super()

A

Used within a constructor to invoke the constructor without any arguments in the direct superclass. May also be used with n arguments to invoke a superclass constructor with n formal arguments.

82
Q

this()

A

Used within a constructor to invoke the constructor without any arguments in the current class. May also be used with n arguments to invoke a constructor with n formal arguments in the current class.

83
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

84
Q

utility class

A

A utility class is one that provides methods (usually static) that perform common functions. The Math class is an example.

85
Q

Writer

A

which are used to write 16-bit character streams.

86
Q

Reader

A

are used to read 16-bit character streams