public class HelloWorld {
public static void main(String[] args) {
int i = 10;
int i2 = 020;
int i3 = 0x12;
int i4 = 0b111;
System.out.println(i);
System.out.println(i2);
System.out.println(i3);
System.out.println(i4);
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!");
}
}
程序运行结果:
10
16
18
7
__________________________________________________
A
65
中
20013
a
Hello World!
Hello
World!
Process finished with exit code 0