标签:static void ring 三元 count i+1 [] main string
/**运算符*/
public class Demo05{
public static void main(String []args){
int i =1;
i+=1;//i=i+1 但是+=不考虑类型转换
System.out.println(i);
byte b =1;
b=(byte)(b+i);//考虑类型转换
System.out.println(b);
b+=i;//不考虑类型转换
System.out.println(b);
//三元运算:判断条件?结果1:结果2
System.out.println(3>2?"大于":"小于");
int count = 0;
System.out.println("count前:"+count);
System.out.println("count++:"+count++);
System.out.println("count中:"+count);
System.out.println("++count:"+ ++count);
System.out.println("count后:"+count);
}
}
标签:static void ring 三元 count i+1 [] main string
原文地址:http://www.cnblogs.com/liuyangv/p/7718819.html