67,513
社区成员
发帖
与我相关
我的任务
分享
public class Test{
public static void main(String args[ ]){
char ch = 'E';
int x = 3;
Object obj = false ? x : ch;
System.out.println(obj.getClass().getSimpleName());
System.out.println(false ? x : ch);
System.out.println(false ? 3 : 'E');
}
}
char ch = 'E';
int x = 3;
Object obj1 = false ? x : ch;
Object obj2 = (false ? 3 : 'E');
System.out.println(obj1.getClass().getSimpleName());
System.out.println(obj2.getClass().getSimpleName());
System.out.println(obj1);
System.out.println(obj2);