欢迎光临
我们一直在努力

scjp认证套题解析之十一_java认证

建站超值云服务器,限时71元/月

51、Which is not a method of the class InputStream?
   A. int read(byte[])
   B. void flush()
   C. void close()
   D. int available()
   (b)
   题目:下面哪个不是InputStream类中的方法

   这个题目没有什么好说的,要求熟悉java API中的一些基本类,题目中的InputStream是所有输入流的父类,所有要很熟悉,参看JDK的API文档。方法void flush()是缓冲输出流的基本方法,作用是强制将流缓冲区中的当前内容强制输出。

   52、Which class is not subclass of FilterInputStream?
   A. DataInputStream

   B. BufferedInputStream

   C. PushbackInputStream

   D. FileInputStream

   (d)

   题目:
   哪个不是FilterInputStream的子类。

   此题也是要求熟悉API基础类。Java基础API中的FilterInputStream 的已知子类有:BufferedInputStream, CheckedInputStream, CipherInputStream, DataInputStream, DigestInputStream, InflaterInputStream, LineNumberInputStream, ProgressMonitorInputStream, PushbackInputStream 。

   53、Which classes can be used as the argument of the constructor of the class
FileInputStream?
   A. InputStream

   B. File

   C. FileOutputStream

   D. String

   (bd)

   题目:哪些类可以作为FileInputStream类的构造方法的参数。

   此题同样是要求熟悉基础API,FileInputStream类的构造方法有三个,可接受的参数分别是:File、FileDescriptor、String类的一个对象。

   54、Which classes can be used as the argument of the constructor of the class FilterInputStream?
   A. FilterOutputStream

   B. File

   C. InputStream

   D. RandomAccessFile

   (c)

   题目:哪些类可以作为FilterInputStream类的构造方法的参数。

   FilterInputStream的构造方法只有一个,其参数是一个InputStream对象。

   55、Given the following code fragment:
   1) switch(m)

   2) { case 0: System.out.println(\”case 0\”);

   3) case 1: System.out.println(\”case 1\”); break;

   4) case 2:

   5) default: System.out.println(\”default\”);

   6) }
   Which value of m would cause \”default\” to be the output?
   A. 0

   B. 1

   C. 2

   D. 3

   (cd)

   题目:给出下面的代码片断:
   …
   m为哪些值将导致\”default\”输出。

   此题考察switch语句的用法,switch的判断的条件必须是一个int型值,也可以是byte、short、char型的值,case中需要注意的是一个case后面一般要接一个break语句才能结束判断,否则将继续执行其它case而不进行任何判断,如果没有任何值符合case列出的判断,则执行default的语句,default是可选的,可以没有,如果没有default而又没有任何值匹配case中列出的值则switch不执行任何语句。

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » scjp认证套题解析之十一_java认证
分享到: 更多 (0)