Lecture 7 - OOP Foundations Flashcards
What is a publicized service made available to others?
Interface
TF: The implementation of an interface is usually visible to user of the interface
False. Implementation generally hidden
At what time is a collection of classes organized into packages (hint: static point of view)?
At compile-time
At what time is a program a collaborating community of objects that uses class features (data, method)?
At runtime
What are Basic (primitive) types?
- int
- long
- double
- void
- boolean
What are Reference types?
- Class
- Interface
- Array
TF: A stack cannot hold the value of a primitive type
False. It can
TF: A stack can hold the value NULL
True
TF: A stack cannot hold a reference (pointer) to an object allocated in Heap
False. It can
TF: A stack can hold Objects
False. It cannot
TF: A heap can only hold objects that were created via “new”
True
What are the two things defined by a class?
- A type
- An implementation
What is defined by an interface?
- A type
(without an implementation)
Note: interface has no logic (logic defined by class implementing interface)
What are the two types an expression can have?
- Compile-time (static) type
- Runtime (dynamic) type
The compile-time type is also known as…
The declared type