体会Java中方法的调用
package Method;
public class Rectangle {
public static void main(String[] args) {
Rectangle r1=new Rectangle();
System.out.println("矩形面积为:"+r1.method(3, 2));
}
public int method(int m,int n) {
for(int i=0;i<m;i++) {
for(int j=0;j<n;j++) {
System.out.print("*");
}
System.out.println();
}
return m*n;
}
}