模块化编程编程
将程序按照功能分为不一样的模块模块化
不一样模块的程序写在不一样的包中,开发
共同的代码抽取出来造成Util类,为方便调用通常为static的it
项目初期,按照业务功能划分模块,即自上而下的方法。开发的过程当中,按照功能划分,即自下而上法。io
Java输入输出流程序
try{方法
FileInputStream in = new FileInputStream(new File(inPath));项目
FileOutputStream out = new FileOutputStream(new File(outPath));static
byte[] b= new byte[1024];while
int len = in.read(b);
while(len!=-1){
out.write(b);
}
}catch(FileNotFoundException e){
e.printStaticTrace();
}finally{
in.close();
out.flush();
out.close();
}