class Promote {
public static void main(String args[]) {
byte b = 30;
char c = 'a';
short s = 1528;
int i = 6800;
float f = 4.32f;
double d = 0.3561;
double result= (f*b)+(i/c)-(d*s) //result用来存放表达式的运算结果
System.out.println("f * b = " + f * b);
System.out.println("i / c = " + i / c);
System.out.println("result = " + d * s);
}
}
输出错误:
D:\code>javac Promote.java
Promote.java:9: unexpected type
required: class
found   : value
        double result= (f*b)+(i/c)-(d*s) //result用来存放表达式的运算结果
                                     ^
1 error
高手请问改怎么修改,运行通过呢?