Question: Rewrite the program using an abstract class/method so that you can use the following code in your main method. in your main method rect.area (10.0,

 Rewrite the program using an abstract class/method so that you can

Rewrite the program using an abstract class/method so that you can use the following code in your main method. in your main method rect.area (10.0, 5.0) triangle.area (9.5, 3.0) class Area public static double width, height; public static void rectArea) double result = width * height; System.out.println ("Rect area "+ result); public static void triArea) double result = width * height / 2.0; System.out.println ("Tri area "+ result) public class mq12 public static void main(String args]) Area.width = 10.0; Area.height = 5.0; Area rectArea) Area.width - 9.5; Area height - 3.0 Area.triArea

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!