Question: What is the output of the following code? class Rectangle { private int len; private int wid; public Rectangle() { this.len =5 this.wid =5 }
What is the output of the following code? class Rectangle \{ private int len; private int wid; public Rectangle() \{ this.len =5 this.wid =5 \} this.len = len; public Rectangle(int len, int wid) \{ this.len this. wid = wid; return len; public int getWid) \{ return waid; public void setLen(int len) \{ if ( len >0) this.len = len; public void setWid(int wid) \{ if(wid >0 ) this.wid = wid; public int area () \{ return len wid; \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
