[AppleScript] 纯文本查看 复制代码
public static void main(String[] args) {
char x ='X';
int y=18;
short s =18;
byte b =18;
double d =1.0;
System.out.println("---------char x; 66-------------");
System.out.println(true?66:x); // B
System.out.println(true?x:66); // X
System.out.println(false?66:x); // X
System.out.println(false?x:66); // B
System.out.println("---------char x; int y-------------");
System.out.println(true?y:x); // 18
System.out.println(true?x:y); // 88
System.out.println(false?y:x); // 88
System.out.println(false?x:y); // 18
System.out.println("--------byte b; char x--------------");
System.out.println(true?b:x); // 18
System.out.println(true?x:b); // 88
System.out.println(false?b:x); // 88
System.out.println(false?x:b); // 18
System.out.println("--------short s; char x--------------");
System.out.println(true?s:x); // 18
System.out.println(true?x:s); // 88
System.out.println(false?s:x); // 88
System.out.println(false?x:s); // 18
System.out.println("--------double d ;char x---------------");
System.out.println(true?d:x); // 1.0
System.out.println(true?x:d); // 88.0
System.out.println(false?x:d); // 1.0
System.out.println(false?d:x); // 88.0
System.out.println("--------1.0 ;char x---------------");
System.out.println(true?1.0:x); // 1.0
System.out.println(true?x:1.0); // 88.0
System.out.println(false?x:1.0);// 1.0
System.out.println(false?1.0:x);// 88.0
}
}