2015/02/101 [Java] 16. Wrapper class Wrapper class 는 non - primitive type 에 primitive type을 넣을때 쓴다. Object [] arr = new Object[3]; Integer wInt = new Integer(3); arr[0] = wInt ; 이런 형식으로 사용한다. 그럼 다시 primitive type으로도 꺼낼수도 있지 않을까? int a = wInt.intValue(); intValue()를 통해 int 자료형으로 뽑아올수 있게 됬다. 대표적으로 쓰는 곳은 아마도 String Object 일것이다. public class Test { public static void main(String args[]) { String a ; Integer wInt = new Integer(3); a = w.. 2015. 2. 10. 이전 1 다음