-----数据运算----- |
运算 |
result:
package hall;
public class Yun{
private double data1=0;
private double data2=0;
private int sign=0;
private double result=0;
public Yun(){
}
public void setData1(double data1)
{
this.data1 = data1;
}
public double getData1(){
return this.data1;
}
public void setData2(double data2)
{
this.data2 = data2;
}
public double getData2(){
return this.data2;
}
public void setSign(int sign){
this.sign = sign;
}
public int getSign(){
return this.sign;
}
public double getResult{
swich(sign)
{
case 0:result=data1+data2;break;
case 1:result=data1-data2;break;
case 2:result=data1*data2;break;
case 3:result=data1/data2;break;
return rusult;
}
}
我没调试,不知行不行
你写的JAVA程度根本就不对呀!
-----数据运算----- |
运算 |