摘要: public static void main(String[] args) { toBin(6); } /* 十进制转换为二进制 */ public static void toBin(int num) { while(num>0) { System.out.println(num... 阅读全文
posted @ 2015-07-25 15:08 IT苦力工 阅读(298) 评论(0) 推荐(0) 编辑
摘要: /*对给定数组进行排序{5,7,2,8,9,1,3,4}*/class ArrayTest2{/*选择排序内循环结束一次,最值出现在头角标位置上*/public static void SelectSort(int[] arr){for(int x=0;xarr[y]){/*int temp=arr... 阅读全文
posted @ 2015-07-25 14:57 IT苦力工 阅读(422) 评论(0) 推荐(0) 编辑
摘要: 自学java,发现基础知识跟其他语言都是相同的,慢慢深入,反复推敲,让代码在敲击键盘中熟能生巧。 阅读全文
posted @ 2015-07-25 14:50 IT苦力工 阅读(318) 评论(0) 推荐(0) 编辑
摘要: class FunctionDemo2 { public static void main(String[] args) { /* int sum=getSum(4,6); System.out.println("sum="+sum); */ //get(4,5)); } public s... 阅读全文
posted @ 2015-07-25 14:48 IT苦力工 阅读(16833) 评论(0) 推荐(0) 编辑
摘要: /* 什么时候用重载? 当定义的功能相同,但参与运算的未知内容不同, 那么,这时就定义一个函数名称以表示起功能,方便阅读,而通过参数列表的不同来区分多个同名函数 */class FunctionOverload { public static void main(String[] args) { ... 阅读全文
posted @ 2015-07-25 14:47 IT苦力工 阅读(315) 评论(0) 推荐(0) 编辑
摘要: /* 1、定义一个功能,用于打印矩形。 2、定义一个打印99乘法表功能的函数。 */ class FunctionTest { public static void main(String[] args) {// draw(5,6);// printHr();// draw(7,9);... 阅读全文
posted @ 2015-07-25 14:46 IT苦力工 阅读(297) 评论(0) 推荐(0) 编辑