SCJP程序员认证考试

多选题In the Java API documentation which sections are included in a class document?()AThe description of the class and its purposeBA list of methods in its super classCA list of member variableDThe class hierarchy

题目
多选题
In the Java API documentation which sections are included in a class document?()
A

The description of the class and its purpose

B

A list of methods in its super class

C

A list of member variable

D

The class hierarchy

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

多选题
Which declarations of identifiers are legal?()
A

$persons

B

TwoUsers

C

*point

D

this

E

_endline


正确答案: B,C
解析: Java的标识符可以以一个Unicode字符,下滑线(_),美元符($)开始,后续字符可以是前面的符号和数字,没有长度限制,大小写敏感,不能是保留字。

第2题:

单选题
Given the following code:    public class Test {  void printValue(int m){  do {  System.out.println("The value is"+m);     }  while( --m > 10 )     }  public static void main(String arg[]) {     int i=10;  Test t= new Test();     t.printValue(i);     }     }  Which will be output?()
A

 The value is 8

B

 The value is 9

C

 The value is 10

D

 The value is 11


正确答案: D
解析: 此题考察的是do… while循环和 -- 操作符的知识,do…while最少被执行一次,在执行完do中的内容后判断while中的条件是否为true,如果为true的话就再执行do中的内容,然后再进行判断,以此类推直到while的判断为false时退出循环执行循环后面的内容,而—操作符的规则是在变量右边的-- 将先进行运算,然后才是使变量的值减一,而在变量左边的是先将变量的值减一再运算。

第3题:

单选题
Which statement of assigning a long type variable to a hexadecimal value is correct?()
A

 long number = 345L;

B

 long number = 0345;

C

 long number = 0345L;

D

 long number = 0x345L;


正确答案: D
解析: 十六进制数以0x开头,long型数以L(大小写均可,一般使用大写,因为小写的l和数字1不易区分)。

第4题:

单选题
11. class Cup { }  12. class PoisonCup extends Cup { }  21. public void takeCup(Cup c) {  22. if(c instanceof PoisonCup) {  23. System.out.println(”Inconceivable!”);  24. } else if(c instanceof Cup) {  25. System.out.println(”Dizzying intellect!”);  26. } else {  27. System.exit(0);  28. }  29. }  And the execution of the statements:  Cup cup = new PoisonCup(); takeCup(cup);  What is the output?()
A

 Inconceivable!

B

 Dizzying intellect!

C

 The code runs with no output.

D

 An exception is thrown at runtime.

E

 Compilation fails because of an error in line 22.


正确答案: C
解析: 暂无解析

第5题:

单选题
Given:  int[] myArray=newint[] {1, 2,3,4, 5};  What allows you to create a list from this array?()
A

 List myList = myArray.asList();

B

 List myList = Arrays.asList(myArray);

C

 List myList = new ArrayList(myArray);

D

 List myList = Collections.fromArray(myArray);


正确答案: A
解析: 暂无解析

第6题:

多选题
Which two are true?()
A

An encapsulated, public class promotes re-use.

B

Classes that share the same interface are always tightly encapsulated.

C

An encapsulated class allows subclasses to overload methods, but does NOT allow overriding methods.

D

An encapsulated class allows a programmer to change an implementation without affecting outside code.


正确答案: A,D
解析: 暂无解析

第7题:

单选题
public class Foo implements Runnable (  public void run (Thread t) {  system.out.printIn(“Running.”);  }  public static void main (String[] args)  {  new thread (new Foo()).start();  } )   What is the result?()
A

 An exception is thrown.

B

 The program exists without printing anything.

C

 An error at line 1 causes compilation to fail.

D

 An error at line 2 causes the compilation to fail.

E

 “Running” is printed and the program exits.


正确答案: B
解析: 暂无解析

第8题:

多选题
switch (i)  {  default:  System.out.printIn(“Hello”);  )   What are the two acceptable types for the variable i?()
A

Char

B

Byte

C

Float

D

Double

E

Object


正确答案: A,C
解析: 暂无解析

第9题:

多选题
Which of the following statements are legal?()
A

long l = 4990;

B

int i = 4L;

C

float f = 1.1;

D

double d = 34.4;

E

double t = 0.9F;


正确答案: B,E
解析: 此题的考点是数字的表示法和基本数据类型的类型自动转换,没有小数点的数字被认为是int型数,带有小数点的数被认为是double型的数,其它的使用在数字后面加一个字母表示数据类型,加l或者L是long型,加d或者D是double,加f或者F是float,可以将低精度的数字赋值给高精度的变量,反之则需要进行强制类型转换,例如将int,short,byte赋值给long型时不需要显式的类型转换,反之,将long型数赋值给byte,short,int型时需要强制转换(int a=(int)123L;)。

第10题:

单选题
class A {   public byte getNumber () {   return 1;   }   }   class B extends A {   public short getNumber() {   return 2;   }    public static void main (String args) {   B b = new B ();    System.out.printIn(b.getNumber())  }   }   What is the result?()
A

 Compilation succeeds and 1 is printed.

B

 Compilation succeeds and 2 is printed.

C

 An error at line 8 causes compilation to fail.

D

 An error at line 14 causes compilation to fail.

E

 Compilation succeeds but an exception is thrown at line 14.


正确答案: D
解析: 暂无解析

更多相关问题