题目内容

Java中, 定义子类继承父类用到的关键字是()

A. extends
B. this
C. inheritance
D. final

查看答案
更多问题

定义接口的关键字是()

A. public
B. private
C. interface
D. final

执行下列程序段时, 若文件"file.dat"不存在, 则输出结果是()try { FileInputStream fis = new FileInputStream("file.dat");} catch (FileNotFoundException e) { System.out.print("FileNotFoundException")} catch (IOException e) { System.out.print("IOException")}

A. FileNotFoundException
B. IOException
C. FileNotFoundException IOException
D. 空

压缩流所在的包是()

A. java.util.zip
B. java.sound.sampled
C. javax.imageio
D. javax.xml.stream

下列代码实现了将一个文件的内容复制到另一个文件的功能。下划线处应填入的代码是()import java.io.*;public class test { public static void main(String[] args) { try { FileInputStream is = new FileInputStream("D:\\from.txt"); FileOutputStream os = new _______________("D:\\to.txt"); byte[] str = new ___________[1024]; while (is.available() > 0) { is.read(str, 0, 1024); os.write(str); } is.close(); os.close(); } catch (ArrayIndexOutOfBoundsException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }}

A. FileOutputStream, byte
B. FileInputStream, byte
C. FileOutputStream, str
D. FileInputStream, str

答案查题题库