Test Operator[java]

package test;

public class TestOper {

public static void main(String[] args) {
int i = 10;
int n = i++%5;
System.out.println("i="+i);//11
System.out.println(
"n="+n);//0

char c = 'c';
if(Character.isUpperCase(c)){
System.out.println(
"c="+c);
}
if(Character.isLowerCase(c)){
System.out.println(c);
}

int[] arrayOfInts = {1,3,2,4,5};
int searchFor =3;
boolean foundInt = false;
i=0;
for(;i<arrayOfInts.length;i++){
if(arrayOfInts<i>==searchFor){
foundInt = true;
break;
}
}
System.out.println(foundInt);
for(int j = arrayOfInts.length;--j>=0;){
for(int k=0;k<j;k++){
if(arrayOfInts[k]>arrayOfInts[k+1]){
int temp = arrayOfInts[k];
arrayOfInts[k]=arrayOfInts[k+1];
arrayOfInts[k+1]=temp;
}
}
}
for(int l=0;l<arrayOfInts.length;l++){
System.out.println(arrayOfInts[l]+
":"+arrayOfInts[l]);
}
}

}

lunzi   2008-03-09 23:46:06 评论:0   阅读:357   引用:0

发表评论>>

署名发表(评论可管理,不必输入下面的姓名)

姓名:

主题:

内容: 最少15个,最长1000个字符

验证码: (如不清楚,请刷新)

Copyright@2004-2010 powered by YuLog