Abstract - Day 6 Flashcards

1
Q

Abstract

A

An incomplete method and requires a child class to complete it.

Child class MUST implement the abstract methods.

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

Coding with abstract

A

Abstract class encapsulates the common behaviour of its children classes through abstract methods

Non abstract classes that extends an abstract class must implement abstract methods

If it contains abstract method then class is abstract

Class can be abstract without any method

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

Abstract classes enforce_____ and abstract methods enforce ______

A

Inheritance and overriding

Parent reference and child object both refer to an abstract class will always be of the child class

> > “abstract”

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

Why abstract?

A

TO INDUCT INHERITANCE

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

Instanceof operator

A

Tests whether a reference variable is an instance of the specified type (class, subclass or interface)

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