Question: JAVA - public class CallRectangle { public static void main ( String [ ] args ) { Rectangle myRectangle = new Rectangle ( ) ;
JAVA
public class CallRectangle
public static void mainString args
Rectangle myRectangle new Rectangle;
myRectangle.setSize;
if myRectanglegetArea
System.out.printlnFAILED getArea for ;
if myRectanglegetPerimeter
System.out.printlnFAILED getPerimeter for ;
myRectangle.setSize;
if myRectanglegetArea
System.out.printlnFAILED getArea for ;
if myRectanglegetPerimeter
System.out.printlnFAILED getPerimeter for ;
public class Rectangle
private int height;
private int width;
public void setSizeint heightVal, int widthVal
height heightVal ;
width widthVal ;
public int getArea
return height width;
public int getPerimeter
return height width ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
