public class Typeconversion {
public static void main(String[] args) {
byte b = 127;
char c = 'W';
short s = 23561;
int i =3333;
long l =400000L;
float f=3.14159F;
double d = 23.45;
//以下是自动转换
System.out.println(b+c);
System.out.println(b+c+s);
System.out.println(b+c+s+i);
System.out.println(b+c+s+i+l);
System.out.println(b+c+s+i+l+f);
System.out.println(b+c+s+i+l+f+d);
//以下是强制转换
System.out.println((int)l);
System.out.println((short)l);
System.out.println((int)d);
System.out.println((char)s);
}
}
214
23775
27108
427108
427111.16
427134.60625
400000
6784
23
尉