package com.atguigu.java4;
import org.junit.Test;
/*
* 关于包装类使用的面试题
*
*/
public class InterviewTest {
@Test
public void test1(){
Object o1 = true ? new Integer(1) : new Double(2.0);
System.out.println(o1);//1.0 类型提升了成double型了
}
@Test
public void test2(){
Object o2;
if(true)
o2 = new Integer(1);
else
o2 = new Double(2.0);
System.out.println(o2);//1
}
}