黑马程序员技术交流社区

标题: 类加载器之细节问题? [打印本页]

作者: 大大老伴要跪IT    时间: 2014-1-17 23:18
标题: 类加载器之细节问题?
  1.         public static void main(String[] args) throws Exception {
  2.                 // TODO Auto-generated method stub
  3.                 String srcPath = args[0];
  4.                 String destDir = args[1];
  5.                 FileInputStream fis = new FileInputStream(srcPath);
  6.                 String destFileName = srcPath.substring(srcPath.lastIndexOf('\\')+1);
  7.                 String destPath = destDir + "\\" + destFileName;
  8.                 FileOutputStream fos = new FileOutputStream(destPath);
  9.                 cypher(fis,fos);
  10.                 fis.close();
  11.                 fos.close();
  12.         }
复制代码


String srcPath = args[0];
String destDir = args[1];
这两个语句代表什么意思?为什么?求解,谢谢!
作者: §傻、才乖    时间: 2014-1-18 01:40
这个是张老师在做 讲课中自己定义的接收主函数参数的变量
你完全可以想象传参数的时候,会传什么样的值,然后根据传的参数定义变量
操作变量
张老师,这里用到的传给主函数的第一个参数是源文件的完整路径,第二个参数为,目标的路径,相对路径
作者: 花生壳    时间: 2014-1-18 08:40
这个是 存储原路径

目标路径的!




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2