求矩形的面积代码
package com.xiaoa;/**
* @author niyite
*
*/
/*
* 需求:
* 1.求矩形的面积
*/
/*
* 欢迎加群694492408,里面有java全套知识分享
*/
public class MethodDemo01 {
public static void main(String[] args) {
int area = getArea(3,5);
System.out.println("The area is "+ area);
}
//求矩形面积方法
public static int getArea(int a, int b){
int area = a * b;
return area;
}
}