?? recclassdemo.java
字號:
public class RecclassDemo{
double length;
double width;
void setLW(double l, double w){
length=l;
width=w;
}
double area(){
return length*width;
}
public static void main(String args[]){
RecclassDemo r1; //聲明類的對象
r1=new RecclassDemo (); //創建對象,為對象分配空間
r1.setLW(10,20); //調用成員方法進行賦值
System.out.println("The Rectangle area is : "+r1.area()); //調用成員方法計算面積
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -