Question 5
Not yet
answered
Flag question
Examine the following Java code:
abstract class Shape {
abstract void draw();
}
class Circle extends Shape {
void draw() {
System.out.println("Drawing Circle");
}
}
class Test {
public static void main(String[] args) {
}
Shape shape = new Circle();
shape.draw();
}
What concept of OOP is demonstrated by this code snippet?
a. Encapsulation
b. Polymorphism
c. Inheritance
d. Composition