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

1 Expert Approved Answer
Step: 1 Unlock

import javautil Solution class public class Solution public static vo... View full answer

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 Programming Questions!