Java模块化开发

模块化编程

将程序按照功能分为不同的模块

不同模块的程序写在不同的包中,

共同的代码抽取出来形成Util类,为方便调用一般为static的

项目初期,按照业务功能划分模块,即自上而下的方法。开发的过程中,按照功能划分,即自下而上法。

Java输入输出流

try{

FileInputStream in = new FileInputStream(new File(inPath));

FileOutputStream out = new FileOutputStream(new File(outPath));

byte[] b= new byte[1024];

int len = in.read(b);

while(len!=-1){

  out.write(b);

}

}catch(FileNotFoundException e){

  e.printStaticTrace();

}finally{

in.close();

out.flush();

out.close();

}

 

posted @ 2017-04-17 19:13  夏日的微笑  阅读(2522)  评论(0编辑  收藏  举报