• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






百易城

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2014年3月7日

Java的方法参数的传递
摘要: 本文由广州java培训分享: 关于java的方法的参数传递,根据参数类型不同,对于方法的实参的改变也是不同的。 程序的运行结果 /** * main方法 */ public static void main(String[] args) { // int int num = 1; System.out.println("int:改变前的值:" + num); changeValue(num); System.out.println("int:改变后的值:" + num); // Integer Integer num2 = new Integer(1); 阅读全文
posted @ 2014-03-07 11:46 百易城 阅读(174) 评论(0) 推荐(0)
 
Java中使用二分法排序
摘要: 本文由广州疯狂软件java培训分享: 具体代码: import java.util.Scanner; //二分法 public class SplitBy2Sort { public static int splitBy2(int[] a, int num) { int low = 0; int high = a.length - 1; int mid; while (true) { // 取中间下标 mid = (low + high) / 2; if (a[mid] == num) { return mid; } else if (low > high) ... 阅读全文
posted @ 2014-03-07 11:45 百易城 阅读(413) 评论(0) 推荐(0)
 
Java复制文件和文件夹
摘要: 本文由广州疯狂软件java培训分享: Java 复制文件和文件夹 // 复制文件 public static void copyFile(File sourceFile, File targetFile) throws IOException { BufferedInputStream inBuff = null; BufferedOutputStream outBuff = null; try { // 新建文件输入流并对它进行缓冲 inBuff = new BufferedInputStream(new FileInputStream(sourceFile)); //... 阅读全文
posted @ 2014-03-07 11:44 百易城 阅读(327) 评论(0) 推荐(0)