Question: Write in java (b) Consider the following program and state the output of the program if it is correct. Otherwise, find out if there is
Write in java
(b) Consider the following program and state the output of the program if it is correct. Otherwise, find out if there is anything wrong with the program. 2 public class Area { public static void main(String [] args) { Rectangle myRect = new Rectangle (); myRect.width = 40; myRect.height = 50; System.out.println ("myRect's area is " + myRect.area ()); }
Step by Step Solution
3.45 Rating (152 Votes )
There are 3 Steps involved in it
The program is incorrect because class Rectangle is missing it ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
6362fb25a8ca8_236864.pdf
180 KBs PDF File
6362fb25a8ca8_236864.docx
120 KBs Word File
