问到java基础类型,我当时好像都快没印象了,说了几个。
package interview20170616;
public class Question03
{
/**
* 仅提供测试
*
* @author ZengWenFeng
* @date 2011.10.09
* @param args
*/
public static void main(String[] args)
{
//考范围
//byte b = 128;//Type mismatch: cannot convert from int to byte
System.out.println(Byte.MIN_VALUE);
System.out.println(Byte.MAX_VALUE);
//封装类才等于null运用实际业务可以存放空值,空值与0是不一样的
//boolean n = null;//Type mismatch: cannot convert from null to boolean
//一般的说,D 要大写
double d = 0.9239D;
double d1 = 0.9239;
System.out.println(d);
System.out.println(d1);
//Type mismatch: cannot convert from double to float
float f = 0.9239F;
System.out.println(f);
//
long number1 = 345L;
long number2 = 0345;
long number3 = 0345L;
long number4 = 0X345L;
System.out.println(number1);
System.out.println(number2);
System.out.println(number3);
System.out.println(number4);
}
}