• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/125

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

125 Cards in this Set

  • Front
  • Back

abstraction

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

accessor method

A method specifically designed to provide access to a private attribute of a class. Byconvention, we name accessors with a get prefix followed by the name of theattribute being accessed

argument

Information passed to a method. Arguments are also sometimes called parameters.

arithmetic expression

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

arithmetic operator

Operators, such as +, -, *, / and %, that produce a numerical result

array

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

array initializer

An initializer for an array. The initializer takes the place of separate creation andinitialization steps. For instance, the initializer:




int[] pair = { 4, 2, };

assignment operator

The operator (=) used to store the value of an expression into a variable

assignment statement

A statement using the assignment operator.

attribute

A particular usage of an instance variable. The set of attribute values held in aparticular instance of a class define the current state of that instance

binary

Number representation in base 2. In base 2, only the digits 0 and 1 are used.

binary operator

An operator taking two operands

bit

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

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

boolean

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

boolean expression

An expression whose result is of type boolean, i.e. gives a value of either true orfalse. Operators such as && and || take boolean operands and produce a booleanresult

bounds

The limits of an array or collection. In Java, the lower limit is always zero. In the caseof an array, the upper bound is one less than then length of the array

break statement

A statement used to break out of a loop, switch statement or labeled block

byte

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

case label

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

cast

Where Java does not permit the use of a source value of one type, it is necessary touse a cast to force the compiler to accept the use for the target type

class

A programming language concept that allows data and methods to be groupedtogether. The class concept is fundamental to the notion of an object-orientedprogramming language.

class body

The body of a class definition. The body groups the definitions of a class's members -fields, methods and nested classes

class constant

A variable defined as both final and static

class header

The header of a class definition. The header gives a name to the class and defines itsaccess. It also describes whether the class extends a super class or implements anyinterfaces

class inheritance

When a super class is extended by a sub class, a class inheritance relationship existsbetween them. The sub class inherits the methods and attributes of its super class. InJava, class inheritance is single inheritance

class method

A synonym for static method

class scope

Private variables defined outside the methods within a class have class scope. Theyare accessible from all methods within the class, regardless of the order in which theyare defined. Private methods also have class scope

class variable

A synonym for static variable

cohesion

The extent to which a component performs a single well-defined task. A stronglycohesive method, for instance, will perform a single task, such as adding an item to adata structure, or sorting some data, whereas a weakly cohesive method will beresponsible for several disparate tasks

comment

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

compilation

The process of translating a programming language. This often involves translating ahigh level programming language into a low level programming language. The translation is performed by a programcalled a compiler. A Java compiler translates programs into bytecodes.

compiler

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

condition

A boolean expression controlling a conditional statement or loop

conditional operator

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

constant

A variable whose value may not be changed

constructor

A constructor is automatically called when an instance of its class is created. Aconstructor always has the same name as its class, and has no return type.

continue statement

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

control structure

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

decrement operator

It has two forms: pre-decrement (--x)and post-decrement (x--). In its pre-decrement form, the result of the expression isthe value of its argument after the decrement. In its post-decrement form, the result isthe value of its argument before the decrement is performed

data type

There are eight primitive data types in Java. - double, float, int, long and short, boolean, byte, and char.

decimal

Number representation in base 10. In base 10, the digits 0 to 9 are used

default initial value

The default value of any variable not explicitly initialized when it is declared. Fieldsof numeric primitive types have the value zero by default, boolean variables have thevalue false, char variables have the value \u0000 and object references have thevalue null.

default label

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

do loop

One of Java's three control structures used for looping. A do loop consists of a loop body and a boolean expression. Thecondition is tested after the loop body has been completed for the first time and retestedeach time the end of the body is completed. The loop terminates when thecondition gives the value false. The statements in the loop body will always beexecuted at least once.

encapsulation

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

enum

An enum type is a special data type that enables for a variable to be a set ofpredefined constants

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

field

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

first in, first out

The (FIFO) semantics of a queue data structure. Items are removed in the order inwhich they arrived in the queue, so older items are always removed before newerones.

for loop

A for loop consists of a loop header and a loop body. The headerconsists of three expressions separated by two semicolons and one or more of thesemay 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'stermination test. An empty expression represents the value true. The third expressionis evaluated after each completion of the loop's body. The loop terminates when thetermination test gives the value false. The statements in the loop body might beexecuted zero or more times.

hash code

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

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, todefine their own hash function

heterogeneous collection

A collection of objects with different dynamic types.

hexadecimal

Number representation in base 16. In base 16, the digits 0 to 9 and the letters A to Fare used.

homogeneous collection

A collection of objects with the same dynamic type. Arrays are the most commonhomogeneous collection objects

identifier

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

if-else statement

A control structure used to choose between performing one of two alternative actions

if statement

A control structure used to choose between performing or not performing furtheractions.

implicit type conversion

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

import statement

A statement that makes the names of one or more classes or interfaces available in adifferent package from the one in which they are defined

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 thevalue of its argument after the increment. In its post-increment form, the result is thevalue of its argument before the increment is performed

infinite loop

A loop whose termination test never evaluates to false.

information hiding

The practice of ensuring that only as much information is revealed about theimplementation of a class as is strictly required. Ensuring that all fields of a class are defined as private, isone of the ways that we seek to promote information hiding.

inheritance

A feature of object-oriented programming languages in which a sub type inheritsmethods and variables from its super type. Inheritance is most commonly used as asynonym for class inheritance

inheritance hierarchy

The relationship between super classes and sub classes

initializer

A block defined at the outermost level of a class - similar to a method without aheader. Initializer blocks are executed, in order, when an instance is created.

instance

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

instance variable

A non-static field of a class. Each individual object of a class has its own copy of sucha field

instantiation

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

integer

A positive or negative whole number.

interpreter

A program which executes a translated version of a source program by implementinga virtual machine. Interpreters typically simulate the actions of an idealized CentralProcessing Unit. An interpreter for Java must implement the Java Virtual Machine(JVM) and executes the bytecodes produced by a Java compiler

iteration

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

key value

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

last in, first out

The (LIFO) semantics of a stack data structure. Items are removed in the oppositeorder to which they arrived in the stack, so newer items are always removed beforeolder ones

local variable

A variable defined inside a method body

logical error

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

loop variable

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

main method

The starting point for program execution

member

For now, the members of a class are fields and methods

method

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

method header

The header of a method, consisting of the method name, its result type, formalarguments and any exceptions thrown.

method overloading

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

method overriding

A method defined in a super class may be overridden by a method of the same namedefined in a sub class. The two methods must have the same name and number andtypes of formal arguments. Any checked exception thrown by the sub class versionmust match the type of one thrown by the super class version, or be a sub class ofsuch an exception. However, the sub class version does not have to throw anyexceptions that are thrown by the super class version. It is important to distinguishbetween method overriding and method overloading. Overloaded methods have the same names, but differ in their formal arguments

method result

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

method signature

The signature of a method consists of its name and the types of its parameters(enclosed in parentheses and separated by commas).

mutator method

A method specifically designed to allow controlled modification of a privateattribute of a class. By convention, we name mutators with a set prefix followed bythe name of the attribute being modified

newline

The \n character.

new operator

The operator used to create instances

null reference

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

object

An instance of a particular class. In general, any number of objects may beconstructed from a class definition. The class to which anobject belongs defines the general characteristics of all instances of that class. Withinthose characteristics, an object will behave according to the current state of itsattributes and environment.

object-oriented language

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

object reference

A reference to an object. Languages other than Java use term's such as address orpointer.

operand

An operand is an argument of an operator

out of scope

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

polymorphism

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

popup menu

A menu of actions that is normally not visible on the screen until a mouse button isclicked. Popup menus help to keep a user interface from becoming cluttered

primitive type

Java's eight standard non-class types are primitive types: boolean, byte,

protected access

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

public interface

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

real number

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

relational operators

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

reserved word

A word reserved for a particular purpose in Java, such as class, int, public, etc.Such words may not be used as ordinary identifiers.

return statement

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

return type

The declared type of a method, appearing immediately before the method name

return value

The value of the expression used in a return statement

runtime error

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

scope

A language's scope rules determine how widely variables, methods and classes arevisible within a class or program. Local variables have a scope limited to the block inwhich 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.

semantic error

An error in the meaning of program. A statement may have no syntax errors, butmight still break the rules of the Java language.

short-circuit operator

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

single inheritance

In Java, a class may not extend more than one class. This means that Java has a singleinheritance model for class inheritance.

state

Objects are said to possess state. The current state of an object is represented by thecombined values of its attributes. Protecting the state of an object from inappropriateinspection or modification is an important aspect of class design and we recommendthe use of accessor methods and mutator methods to facilitate attribute protection andintegrity

statement

The basic building block of a Java method. There are many different types ofstatement in Java,

statement terminator

The semicolon (;) is used to indicate the end of a statement.

static method

A static method (also known as a class method) is one with the static reserved wordin its header. Static methods differ from all other methods in that they are notassociated with any particular instance of the class to which they belong. They areusually accessed directly via the name of the class in which they are defined

static variable

variableA static variable defined inside a class body. Such a variable belongs to the class asa whole, and is, therefore, shared by all objects of the class. A class variable might beused to define the default value of an instance variable

string

An instance of the String class. Strings consist of zero or more Unicode characters,and they are immutable, once created. A literal string is written between a pair ofstring delimiters (")

sub class

A class that extends its super class. A sub class inherits all of the members of itssuper class. All Java classes are sub classes of the Object class, which is at the root ofthe inheritance hierarchy

super class

A class that is extended by one or more sub classes. All Java classes have the Objectclass as a super class

switch statement

A selection statement in which the value of an arithmetic expression{expression!arithmetic} is compared for a match against different case labels. If nomatch is found, the optional default label is selected

syntax error

An error detected by the compiler during its parsing of a program. Syntax errorsusually result from mis-ordering symbols within expressions and statements. Missingcurly brackets and semicolons are common examples of syntax errors.

uninitialized variable

A local variable that been declared, but has had no value assigned to it. The compilerwill warn of variables which are used before being initialized.

variable declaration

The association of a variable with a particular type. It is important to make adistinction between the declaration of variables of primitive types and those of classtypes. A variable of primitive type acts as a container for a single value of its declaredtype. Declaration of a variable of a class type does not automatically cause an objectof that type to be constructed and, by default, the variable will contain the value null.A variable of a class type acts as a holder for a reference to an object that iscompatible with the variable's class type. Java's rules of polymorphism allow avariable of a class type to hold a reference to any object of its declared type or any ofits sub types. A variable with a declared type of Object, therefore, may hold areference to an object of any class, therefore

while loop

One of Java's three control structures used for looping. The other two are the do loopand for loop. A while loop consists of a boolean expression and a loop body. Thecondition is tested before the loop body is entered for the first time and re-tested eachtime the end of the body is completed. The loop terminates when the condition givesthe value false. The statements in the loop body might be executed zero or moretimes.

wrapper classes

Java's primitive types are not object types. The wrapper classes are defined in thejava.lang package. They consist of a class for each primitive type: Boolean, Byte,Character, Double, Float, Integer, Long and Short. These classes providemethods to parse strings containing primitive values, and turn primitive values intostrings. The Double and Float classes also provide methods to detect special bitpatterns for floating point numbers, representing values such as NaN, +infinity and -infinity