Question: Consider you have the following integer array: int[5] array = {5, 4, 3, 2, 1}; Write a program that shifts the content of the array
Consider you have the following integer array: int[5] array = {5, 4, 3, 2, 1}; Write a program that shifts the content of the array to the right, i.e. the array would become array = {1, 5, 4, 3, 2}; Write the definition of an abstract class Shape that define two abstract methods getArea() and getPerimenter() returning, respectively the area and the perimeter of that Shape. Then write the definition and implementation of a derived classes of class Shape: class Rectangle. Rectangle class defines two private side integer fields and it overrides methods getArea() and getPerimenter() of the Shape class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
