public class SumDemo{
public static void main(String[] args){
double sum = getSum(1.2,2.3);
System.out.println("和为:" + sum );
}
public static double getSum(double a, double b){
return a + b;
}
}
double a = 23.0;
double b = 33.0;
double sum = a + b;
System.out.println("结果是:"+sum);
public class Tests {
public static void main(String[] args) {
double c=sum(1.2,3.2);
System.out.println(c);
}
public static double sum(double a,double b){
return a+b;
}
}