Java, Programming, Object Oriented Design, Objectorientedprogramming, Oop.
double height; public Rectangle(double width, double height) { this.width = width; this.height = height; } @Override public double area() { return width * height; } } public class Main { public static void main(String[] args) { Shape circle = new Circle(5); Shape rectangle = new Rectangle(4, 6);