public class str
{
public static void main(String[] args)
{
float x = 3.0;
System.out.println(x);
}
}
报错:Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from double to float
at str.main(str.java:6)
可以解释一下原理吗?