//int_details
public class intDetails{
public static void main(String[] args) {
int n1 = 1;
int n2 = 1l; //错误
long n3 = 1l;
}
}
public class floatDetail {
public static void main(String[] args) {
float n1 = 1.2f;
double n2 = 1.2;
double n3 = .123;
System.out.println(n3);
//n4 and n5 not equal
double n4 = 2.7;
double n5 = 8.1 / 3;
System.out.println(n4);
System.out.println(n5);
}
}
//show char
public class charDetail {
public static void main(String[] args) {
char c1 = 'a';
char c2 = '\t'; //Escape characters can be used;
//char c3 = '方'; //Chinese can be used; will take two char
char c4 = 97;
System.out.println(c1);
System.out.println(c2);
//System.out.println(c3);
System.out.println(c4);
System.out.println((int)c1);
char c5 = 38889;
System.out.println(c5);
//Can perform digital operations
System.out.println('a' + 10);
//what to output? check the ASCII table;
char c6 = 'b' + 1;
System.out.println(c6);
System.out.println((int)c6);
}
}