Question: Chapter Number:9 Inheritance and Interfaces 1) Write a java program that have a super class named Shape with a) Private data member String name b)

 Chapter Number:9 Inheritance and Interfaces 1) Write a java program that

Chapter Number:9 Inheritance and Interfaces 1) Write a java program that have a super class named Shape with a) Private data member String name b) Method area with one integer parameter that have no implementation (return zero) c) Constructor with no parameter to set the name into "square" There is a subclass inherited from Shape called Square with: a) Private data member int length b) Method area take one parameter and return the square area (length"length) c) Constructor that call the superclass constructor Test your sub class methods area on the main using the value 5

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!