Algorithms 1.2 Flashcards

1
Q

Object-oriented programming

A

Based on building data types

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

Data type

A

A set of values and a set of operations on those values

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

Abstract data type

A

a data type whose internal representation is hidden form the client

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

Objects

A

an entity that can take on a data-type value

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

Characterization of objects (3 properties)

A

1) State of an object- value from its data type
2) Identity of an object distinguishes one object from another
3) behavior of an object is the effect of data-type operations

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

reference

A

a mechanism for accessing an object

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

API

A

list of constructors and instance methods

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

client

A

program that uses a data type

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

implementation

A

the code that implenets the data type specified in an API

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

Creating an object for a abstract data type

A

First, you must create an object my invoking a constructor ( new). Everytime a client uses new the system allocates memory space for the object, initializes its value and returns a reference to the object

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

Invoking instance methods

A

e.g. heads.tally () - tails.tally

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

Assignment Statements

A

A copy of a reference can be created. Leads to a situation called aliasing

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

Objects as arguments

A

Objects can be used as arguments

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

Objects as return values

A

An object can be used as a return value from a method

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

Arrays are objects

A

Every value of any nonprimitive type is an object. E.g. arrays are objects

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

Arrays of Objects

A

An array can also be filled with objects. Create by using the bracket syntax for array constructors and than create each object

17
Q

Constructors

A

establishes an object’s identity and initializes the instance variables

18
Q

Immutable

A

data type which has the property that the value of an object never changes. Accomplished using “final”

19
Q

Arithmetic Exception

A

Thrown when an exceptional arithmetic condition occurs

20
Q

ArrayIndexOutOfBoundsException

A

Thrown when an array is accessed with an illegal index

21
Q

NullPointerException

A

Thrown when null is used where an object is required

22
Q

OutOfMemoryError

A

Thrown when the java virtual machine cannot allocate an object because it is out of memory

23
Q

StackOverflowErrorw

A

Thrown when a recursive method recurs too deeply