Question: I want the code in java Create a class called Shape with a protected data member called width. The class will have the following member

I want the code in java
Create a class called Shape with a protected data member called width. The class will have the following member functions: - Default constructor that set the value to 0 . - A constructor to accept the value. - Display the data member. Create 2 classes that inherit from the class Shape called Square and Rectangle. Class Rectangle had a data member called length. Both the class will have the following data members: - Default constructor that set the value to 0 . - A constructor to accept the value. - Insert values into the shapes - Display the data members. - Calculate and return the area of the shapes - Calculate and return the perimeter of the shapes You are required to write a program to demonstrate the above class and member functions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
