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 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
Get step-by-step solutions from verified subject matter experts
