📄 crctngle.java
字号:
class Rectangle
{
private int width;
private int length;
Rectangle()
{
length=30;width=20;
}
Rectangle(int l,int w)
{
length=l;width=w;
}
Rectangle(Rectangle r)
{
width=r.width();
length=r.length();
}
int width()
{
return width;
}
int length()
{
return length;
}
}
public class CRctngle
{
public static void main(String args[ ])
{
Rectangle x1=new Rectangle();
Rectangle x2=new Rectangle(50,40);
Rectangle x3=new Rectangle(x1);
System.out.println(x1.length());
System.out.println(x1.width());
System.out.println(x2.length());
System.out.println(x2.width());
System.out.println(x3.length());
System.out.println(x3.width());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -