public class OK { public static void main(String[] args) { System.out.println("ok"); int ok = 123; System.out.println(ok); System.out.println(" b = " + ok); System.out.println("z = " + ok++); System.out.println("z = " + ++ok); System.out.println("z = " + ok--); System.out.println("z = " + --ok); int a = ++ok; System.out.println("z = "+ a ); int m = 1 , n = 2, o = 3 ,p = 4; System.out.println("ok = "+ ((m + n) *o /(p - o) + p) ); System.out.println("ok = "+ (m + n) *o /(p - o) + p ); System.out.println("ok = "+ p % n ); System.out.println("ok = " +( m > n)); System.out.println("ok = " + (p >= p)); System.out.println("ok = " + (p != p)); System.out.println("ok = " +((p > m )&&(p < m))); System.out.println("ok = " +((p > m )||(p < m))); boolean OK = (p != p) && (n < o); System.out.println(OK ); boolean Ok = (p != p) || (n < o); System.out.println(Ok ); //p *= ok; System.out.println(p); System.out.println(p * ok); System.out.println("p =" + p * ok ); System.out.println("p =" + p * ok + 1 ); System.out.println( p * ok + 1 ); String jj = p > m ? "yes":"no"; System.out.println(jj ); String gg ="girl" ,bb ="boy"; if (m > n) { System.out.println( gg );} else System.out.println(bb ); String GG = m > n?"girl":"boy"; System.out.println(GG);
输出结果为:
ok
123
b = 123
z = 123
z = 125
z = 125
z = 123
z = 124
ok = 13
ok = 94
ok = 0
ok = false
ok = true
ok = false
ok = false
ok = true
false
true
4
496
p =496
p =4961
497
yes
boy
boy
时间: 2024-10-26 02:31:36