Question: Given an integer N, create an Abstract class Shape with an abstract method printArea that accepts integer parameter and has return type void. Also, create
Given an integer N, create an Abstract class “Shape” with an abstract method “printArea” that accepts integer parameter and has return type void.
Also, create a “Square” class inherited from “Shape” class which implements a “printArea” method to print the area of the square (Area of Square = N2).
Input
50
Output
2500
Assume that,
- N is an integer within the range [1 to 1000000].
import java.util.*;
public class Solution {
public static void main(String[] args) {
//Write your code here
}
}
Step by Step Solution
3.44 Rating (144 Votes )
There are 3 Steps involved in it
import javautil Solution class public class Solution public static vo... View full answer
Get step-by-step solutions from verified subject matter experts
