public class WrapperExample {
public static void main(String[] args) {
// オートボクシング (int -> Integer の自動変換)
Integer numObj = 100; // Integer.valueOf(100) が自動実行される
// アンボクシング (Integer -> int の自動変換)
int num = numObj; // numObj.intValue() が自動実行される
// 文字列からプリミティブ数値への変換
int parsedNum = Integer.parseInt("123");
double parsedDouble = Double.parseDouble("3.14");
System.out.println(parsedNum + 7); // 130
}
}