关于强制转化的问题
package Convert;public class Convert {
public static void main(String[] args) {
int i=1,j=1,i1,i2;
float f1=0.1f;
float f2=123;
long l1=12345678,l2=8888888888l;
double d1=2e20,d2=124;
byte b1=1,b2=2,b3=127;
j=j+10;
i1=i/10;
i2=(int)(i*0.1);
char c1='a',c2=125;
byte b=(byte)(b1-b2);
char c=(char)(c1+c2-1);
float f3=f1+f2;
float f4=(float)(f1+f2*0.1);
double d=d1*i+j;
float f=(float)(d1*5+d2);
System.out.println("j="+j);
System.out.println("i1="+i1);
System.out.println("i2="+i2);
System.out.println("b="+b);
System.out.println("c="+c);
System.out.println("f3="+f3);
System.out.println("f4="+f4);
System.out.println("d="+d);
System.out.println("f="+f);
}
}
输出为:
j=11
i1=0
i2=0
b=-1
c=?
f3=123.1
f4=12.4
d=2.0E20
f=1.0E21
请问为什么c的输出为?