本帖最后由 曹玉龙 于 2013-3-26 22:13 编辑
可以啊,更正下,有不实例化的作用.
随手弄个代码,看下- import java.io.BufferedInputStream;
- import java.io.BufferedOutputStream;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.IOException;
- //无抽象方法的抽象类
- abstract class aaa
- {
- public static void bbb()
- {}
- }
- //复制MP3((把c盘目录下的a.mp3中的内容复制到d盘下的b.mp3中)
- public class Demo
- {
- public static void main(String[] args)throws IOException
- {
- BufferedInputStream br = new BufferedInputStream(new FileInputStream("c:\\a.mp3"));
- BufferedOutputStream bw = new BufferedOutputStream(new FileOutputStream("f:\\b.mp3"));
- byte[] bys = new byte[1024];
- int len = 0;
- while((len=br.read(bys))!=-1)
- {
- bw.write(bys,0,len);
- bw.flush();
- }
- bw.close();
- br.close();
- }
- }
复制代码 |