首页>代码>eclipse junit单元测试工具的初次使用>/JUnitTest/src/andycpp/Calculator.java
package andycpp;

public class Calculator {
  private int result; // 静态变量,用于存储运行结果
  
  public void add(int n) { 
    result = result + n; 
			}
	public void substract(int n){ 
		result = result - 1; 
	}
	public void multiply(int n){ } // 此方法尚未写好
	public void divide(int n) { 
		result = result / n; 
		}
	public void square(int n) { 
		result = n * n;
	}
	public void squareRoot(int n){ 
		for(;;); 
	}
	public void clear(){ 
		result = 0; 
	} // 将结果清零
	public int getResult(){ 
		return result; 
	}

}
最近下载更多
阿风啦  LV14 2021年4月4日
doujie  LV5 2020年5月31日
JinghanHe  LV8 2020年3月23日
f1205513291  LV1 2019年12月21日
lironggang  LV38 2019年12月2日
ZpongZ  LV6 2019年10月6日
TY0165  LV9 2018年11月30日
komajojo  LV2 2018年6月21日
1006148200  LV7 2018年6月19日
shanfeng  LV5 2018年4月7日
最近浏览更多
2011502295  LV6 2022年12月27日
阿风啦  LV14 2021年4月4日
lyn520  LV3 2021年1月5日
xiaoyumao  LV2 2020年12月12日
xmjying  LV13 2020年9月16日
渣渣辉壹号 2020年8月25日
暂无贡献等级
cypzuidaima123  LV1 2020年8月14日
qazwsx121212 2020年6月14日
暂无贡献等级
郭QQ159  LV2 2020年6月11日
1049066887  LV12 2020年6月8日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友