public static void main(String[] args)
{
String str=" i am a student";
char[] c=str.toCharArray();
char[] temp=new char[c.length];
for(int i=0,j=c.length-1;i<c.length;i++,j--){
temp[j]=c[i];
}
public static void main(String[] args)
{
String str = "I am a student";
String[] str2 = str.split(" ");
for(int i = str2.length - 1;i >= 0;i--)
{
System.out.print(str2[i] + " ");
}
System.out.println();
}
System.out.println(temp);
}
posted on 2008-08-29 09:36
长春语林科技 阅读(321)
评论(0) 编辑 收藏 所属分类:
java