Create four (4) classes: • Main (where the main method is) • Shapes (Parent/Super class) • Square (Subclass) • Rectangle (Another Subclass) a) Add a new method in the base class of Shapes.java that...


Create four (4) classes:<br>• Main (where the main method is)<br>• Shapes (Parent/Super class)<br>• Square (Subclass)<br>• Rectangle (Another Subclass)<br>a) Add a new method in the base class of Shapes.java that prints a message, but don't<br>override it in the derived classes. Explain what happens.<br>b) Now override it in one of the derived classes but not the others, and see what happens.<br>c) Finally, override it in all the derived classes.<br>d) Add a new type of Shape to Shapes.java and verify in main( ) that polymorphism<br>works for your new type as it does in the old types.<br>

Extracted text: Create four (4) classes: • Main (where the main method is) • Shapes (Parent/Super class) • Square (Subclass) • Rectangle (Another Subclass) a) Add a new method in the base class of Shapes.java that prints a message, but don't override it in the derived classes. Explain what happens. b) Now override it in one of the derived classes but not the others, and see what happens. c) Finally, override it in all the derived classes. d) Add a new type of Shape to Shapes.java and verify in main( ) that polymorphism works for your new type as it does in the old types.

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here