Lecture 7 - OOP Foundations Flashcards

1
Q

What is a publicized service made available to others?

A

Interface

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

TF: The implementation of an interface is usually visible to user of the interface

A

False. Implementation generally hidden

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

At what time is a collection of classes organized into packages (hint: static point of view)?

A

At compile-time

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

At what time is a program a collaborating community of objects that uses class features (data, method)?

A

At runtime

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

What are Basic (primitive) types?

A
  • int
  • long
  • double
  • void
  • boolean
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are Reference types?

A
  • Class
  • Interface
  • Array
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

TF: A stack cannot hold the value of a primitive type

A

False. It can

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

TF: A stack can hold the value NULL

A

True

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

TF: A stack cannot hold a reference (pointer) to an object allocated in Heap

A

False. It can

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

TF: A stack can hold Objects

A

False. It cannot

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

TF: A heap can only hold objects that were created via “new”

A

True

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

What are the two things defined by a class?

A
  • A type
  • An implementation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is defined by an interface?

A
  • A type
    (without an implementation)
    Note: interface has no logic (logic defined by class implementing interface)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the two types an expression can?

A
  • Compile-time (static) type
  • Runtime (dynamic) type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly