public class Demo {
public static void main(String args[]) {
int x = 10 ;
double y = 20.2 ;
long z = 10L;
String str = "" + x + y * z ;
System.out.println(str) ;
}
}
*的优先级比+高
z = 10 y = 20.2 x = 10,首先是y*z = 202,然后“” + 10.0 = “10.0”,“10.0” + 202 = “10202.0”