数据类型的扩展 面试题
public class Demo01 {
public static void main ( String[ ] args) {
int i = 10 ;
int i2 = 010 ;
int i3 = 0x10 ;
int i4 = 0b010101001 ;
System. out. println ( i) ;
System. out. println ( i2) ;
System. out. println ( i3) ;
System. out. println ( i4) ;
System. out. println ( "============================================" ) ;
float f= 0.1f ;
double d= 1.0 / 10 ;
System. out. println ( f== d) ;
float d1= 123123123123123123f ;
float d2= d1+ 1 ;
System. out. println ( d1== d2) ;
System. out. println ( "============================================" ) ;
char c1 = 'a' ;
char c2 = '中' ;
System. out. println ( c1) ;
System. out. println ( ( int ) c1) ;
System. out. println ( c2) ;
System. out. println ( ( int ) c2) ;
char c3 = '\u0061' ;
System. out. println ( c3) ;
System. out. println ( "Hello\tworld" ) ;
System. out. println ( "Hello\nworld" ) ;
System. out. println ( "============================================" ) ;
String sa = new String ( "hellow world" ) ;
String sb = new String ( "hellow world" ) ;
System. out. println ( sa== sb) ;
String sc = "hellow world" ;
String sd = "hellow world" ;
System. out. println ( sc== sd) ;
boolean flag= true ;
if ( flag== true ) { }
if ( flag) { }
}
}