这是我的代码:
class test{
public static void main(String arg[]){
int a=10, b=20;
float c = 30.123;
int e = (int)c;
System.out.println(e);
}
}
我收到此错误:
test.java:6: error: possible loss of precision
float c = 30.123;
^
required: float
found: double
1 error
为什么所有这些?