package day02;
public class PrintfEx1 {
public static void main(String[] args) {
byte b = 1;
short s = 2;
char c = 'A';
String str = "하이";
int finger = 10;
long big = 100_000_000_000L; // long big = 100000000000;는 jdk1.7부터 적용됨
long hex = 0xFFFF_FFFF_FFFF_FFFL;
int octNum = 010; // 8진수 10. 10진수 8
int hexNum = 0x10; // 16진수 10. 10진수 16
int binNum = 0b10; // 2진수 10, 10진수 2
System.out.printf("b=%d%n", b);
System.out.printf("s=%d%n", s);
System.out.printf("big=%d%n", big);
System.out.printf("hex=%x%n", hex);
System.out.printf("c=%c%n", c);
System.out.printf("octNum=%o, %d%n", octNum, octNum);
System.out.printf("hexNum=%x, %d%n", hexNum, hexNum);
//%s는 문자열 출력
System.out.printf("octNum=%s, %d%n", Integer.toBinaryString(binNum), binNum);
}
}
b=1
s=2
big=100000000000
hex=fffffffffffffff
c=A
octNum=10, 8
hexNum=10, 16
octNum=10, 2