2. Write a Java program to calculate the area of square and rectangle. Initialize the side of the square using constructor. Initialize the length and breadth of the rectangle using parameterized...


Solve it Using Scanner


2.<br>Write a Java program to calculate the area of square and rectangle.<br>Initialize the side of the square using constructor.<br>Initialize the length and breadth of the rectangle using parameterized constructor.<br>Create static method to find area of square (Hint: area of square = side X side)<br>Create an instances method to find area of rectangle. (Hint: area of rectangle=length X breadth)<br>Write appropriate main method to invoke the methods and display the results.<br>

Extracted text: 2. Write a Java program to calculate the area of square and rectangle. Initialize the side of the square using constructor. Initialize the length and breadth of the rectangle using parameterized constructor. Create static method to find area of square (Hint: area of square = side X side) Create an instances method to find area of rectangle. (Hint: area of rectangle=length X breadth) Write appropriate main method to invoke the methods and display the results.

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here