package com.java1.day20;
import static java.lang.System.*;
public class WrapperEx5 {
public static void main(String[] args) {
int i = new Integer("100").intValue();
int i2 = Integer.parseInt("100");
Integer i3 = Integer.valueOf("100");
out.println(i);
out.println(i2);
out.println(i3);
int i4 = Integer.parseInt("100", 2);
int i5 = Integer.parseInt("100", 8);
int i6 = Integer.parseInt("100", 16);
int i7 = Integer.parseInt("FF", 16);
out.println("100(2) -> "+ i4);
out.println("100(8) -> "+ i5);
out.println("100(16) -> "+ i6);
out.println("FF(16) -> "+ i7);
Integer i9 = Integer.valueOf("100", 2);
Integer i10 = Integer.valueOf("100", 8);
Integer i11 = Integer.valueOf("100", 16);
Integer i12= Integer.valueOf("FF", 16);
out.println("100(2) -> "+ i9);
out.println("100(8) -> "+ i10);
out.println("100(16) -> "+ i11);
out.println("FF(16) -> "+ i12);
}
}
출력결과
100
100
100
100(2) -> 4
100(8) -> 64
100(16) -> 256
FF(16) -> 255
100(2) -> 4
100(8) -> 64
100(16) -> 256
FF(16) -> 255