相关代码 |
|
// condition.Java public class condition { public static void main(String [] args) { int a=3,b=8; int c = (a>b)?a++:b++; // a不变 System.out.println ("a ="+a+ "\tb="+b+ "\tc="+c); int d = (a>b)?++a:++b; //a不变 System.out.println ("a ="+a+ "\tb="+b+ "\td="+d); int e = (a System.out.println ("a ="+a+ "\tb="+b+ "\te="+e); int f = (a System.out.println ("a ="+a+ "\tb="+b+ "\tf="+f); } }// end class condition