Api05 - 박싱/언박싱

Jonny·2022년 2월 21일
0

API

목록 보기
5/12
package day11;

public class Api05 {
	public static void main(String[] args) {

		int i = 20; 
		Integer intobj = i; 
		
		int j = intobj + 10; 
		
		
		// 문자열 -> 기본형 
		int a = Integer.parseInt("123");
		boolean b = Boolean.parseBoolean("true"); 
		double d = Double.parseDouble("3.14"); 
		
		int x = 10; 
		Object obj = x; 
		System.out.println(obj.getClass());
		
	
		/*
		Integer i = new Integer(10); 
		int ii = i.intValue(); 
		System.out.println(ii);
		int iii = i; 
		
		int a = 10; 
		Integer iCls = a; 
		
			
		Character c = new Character('c'); 
		Double d = new Double("3.14");
		Boolean b = new Boolean(true);
		Float f = new Float(3.14); 
		*/
		

	}
}
profile
Jonny의 Java 공부

0개의 댓글