Solution :
public class Rectangle
{
int len,bre;
Rectangle(int l,int b)
{
setLength(l);
setBreadth(b);
}
void setLength(int l)
{
len=l;
}
void setBreadth(int b)
{
bre=b;
}
int getLength()
{
return len;
}
int getBreadth()
{
return bre;
}
void makeSquare(Rectangle r)
{
r.setBreadth(len);
System.out.println("Square Parameter");
System.out.println("Length:" +r.getLength() + " Length: ".getBreadth());
}
public static void main(String[] args){
Rectangle r=new Rectangle(10,5);
System.out.println("Rectangle Parameter");
System.out.println("Length:"+r.getLength()+" Breadth:"+r.getBreadth());
r.makeSquare(r);
}
}
}