uncensored2017. 1. 6. 22:18
package variableTest;

public class WrapperClassTest {

	public static void main(String[] args) {
		// boxing
		int a = 123;
		Integer iA = new Integer(a);
		System.out.println(iA.getClass());
		System.out.println(iA);
		// auto boxing
		Integer iB = 456;
		System.out.println(iB.getClass());
		System.out.println(iB);
		// unboxing
		int b = iA.intValue();
		System.out.println(b);
		// auto unboxing
		int c = iA;
		System.out.println(c);
		
		Float abc = Float.parseFloat("1234.56f");
		float def = Float.valueOf("123.456");
		System.out.println(abc);
		System.out.println(def);
	}
}


'uncensored' 카테고리의 다른 글

오픈소스 라이선스  (0) 2017.02.25
개발자 취준생에게 팁  (0) 2017.02.25
웹 개발자 직군 정리  (0) 2017.02.25
[Java]개발환경 구성  (0) 2017.01.02
01.안드로이드 구성요소  (0) 2016.09.18
Posted by spillmoon