求学资讯 JAVA培训 提问
JAVA培训 > 历年真题

JAVA认证SCJP认证真题及答案(16)

来源:用户上传 上传用户:zhongzhanen 发布时间:2017-12-28

导读:
想要第一时间获得JAVA考试报考信息,想要充分利用各种精华资讯资源备考,想要海量高质量、高含金量的习题练习,关注“求学快递网”公众号,你不能错过的考试利器!

  QUESTION NO 136

  Which constructs a DataOutputStream?

  A. New dataInputStream(“in.txt”);

  B. New dataInputStream(new file(“in.txt”));

  C. New dataInputStream(new writer(“in.txt”));

  D. New dataInputStream(new FileWriter(“in.txt”));

  E. New dataInputStream(new InputStream(“in.txt”));

  F. New dataInputStream(new FileInputStream(“in.txt”));

  Answer: F

  QUESTION NO 137

  Which can be used to decode charS for output?

  A. Java.io.InputStream.

  B. Java.io.EncodedReader.

  C. Java.io.InputStreamReader.

  D. Java.io.InputStreamWriter.

  E. Java.io.BufferedInputStream.

  Answer: C

  QUESTION NO 138

  Given:

  1. public class Test {

  2. public static void main (String args) {

  3. string foo = “blue”;

  4. string bar = foo;

  5. foo = “green”;

  6. System.out.printIn(bar);

  7. }

  8. }

  What is the result?

  A. An exception is thrown.

  B. The code will not compile.

  C. The program prints “null”

  D. The program prints “blue”

  E. The program prints “green”

  Answer: D

  QUESTION NO 139

  Which code determines the int value foo closest to a double value bar?

  A. Int foo = (int) Math.max(bar);

  B. Int foo = (int) Math.min(bar);

  C. Int foo = (int) Math.abs(bar);

  D. Int foo = (int) Math.ceil(bar);

  E. Int foo = (int) Math.floor(bar);

  F. Int foo = (int) Math.round(bar);

  Answer: F |||

  QUESTION NO 140

  Which two demonstrate encapsulation of data? (Choose Two)

  A. Member data have no access modifiers.

  B. Member data can be modified directly.

  C. The access modifier for methods is protected.

  D. The access modifier to member data is private.

  E. Methods provide for access and modification of data.

  Answer: D, E

声明:本站为免费网络服务提供商,网站所有信息均为用户自行发布并由用户承担相应法律责任,本站不对其真实性及合法性负责,如涉及侵权或者信息违法,请你及时与本站联系删除。

阅读 645 举报

相关推荐
评论0

当前没有评论内容

发表评论 0条评论
95
微博
QQ
QQ空间
微信
取消