212 - Advanced Programming Flashcards
1
Q
Types of languages
A
- Imperative/ procedural
- Object oriented
- Declarative
- (Pure) functional
2
Q
Identify what each part of this statement is
Person p = new Person()
A
Person = Class p = Instance variable () = Constructor
3
Q
What does inheritance do in OO languages? (Object Oriented)
A
It provides a mechanism to promote reuse and extensibility
4
Q
What is a class that is being extended known as?
A
Base, Super or Parent class.
The new class is known as a subclass
5
Q
How to define a single super class in Java
A
By using (extends) as Java is a single inheritance language
6
Q
Inheritance hierarchy example
A
Mammal
/ \
Whale Person
/ / \
Humpback Student Lecturer