Question: Identify the object - oriented principle applied in this code. public interface Shape { double calculateArea ( ) ; } public class Circle implements Shape

Identify the object-oriented principle applied in this code.
public interface Shape {
double calculateArea();
}
public class Circle implements Shape {
private double radius;
// Constructor and other methods
@Override
public double calculateArea(){
return Math. ?PI* radius * radius;
}
}
a. Each class in your application should have only one reason to change.
b. None
c. Encapsulate what varies.
d. Classes are about behavior and functionality.
e. Code to an interface rather than to an implementation.
 Identify the object-oriented principle applied in this code. public interface Shape

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!