2013年3月12日
摘要: public class Example3_2{public static void main(String[] args){char a[]={'张','强'};char secret='a';for( int i=0;i<a.length;i++){a[i]=(char)(a[i]^secret);}System.out.printf("密文:\n");for(int i=0;i<a.length;i++){System.out.printf("%3c",a[i]);}for( int i= 阅读全文
posted @ 2013-03-12 20:55 zhangqiang618 阅读(210) 评论(0) 推荐(0) 编辑
摘要: print将它的参数显示在命令窗口,并将输出光标定位在所显示的最后一个字符之后。println 将它的参数显示在命令窗口,并在结尾加上换行符,将输出光标定位在下一行的开始。printf是格式化输出的形式。public class TestPrint {public static void main(String[] args) { int i = 4; double j = 5; System.out.print("用print输出i:"+ i); System.out.println( "用println输出i:"+ i); System.out.pr 阅读全文
posted @ 2013-03-12 20:29 zhangqiang618 阅读(461) 评论(0) 推荐(0) 编辑
摘要: Example1_1: Example2_1:Example2_2:(有关类型的强制转换)Example2_5(使用数组) 阅读全文
posted @ 2013-03-12 20:20 zhangqiang618 阅读(227) 评论(0) 推荐(0) 编辑