多选题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


参考解析

解析: 类文档的内容主要是:类层次、类及用途描述、成员变量列表、构造方法列表、成员方法列表、从类层次上继承的方法列表、成员变量的详细说明、构造方法详细说明、成员方法详细说明。

相关考题:

单选题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;

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

多选题Which declarations of identifiers are legal?()A$personsBTwoUsersC*pointDthisE_endline

多选题Which two are true?()AAn encapsulated, public class promotes re-use.BClasses that share the same interface are always tightly encapsulated.CAn encapsulated class allows subclasses to overload methods, but does NOT allow overriding methods.DAn encapsulated class allows a programmer to change an implementation without affecting outside code.

单选题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 8B The value is 9C The value is 10D The value is 11

单选题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.

单选题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);

多选题Which of the following statements are legal?()Along l = 4990;Bint i = 4L;Cfloat f = 1.1;Ddouble d = 34.4;Edouble t = 0.9F;

单选题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.

单选题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.

单选题Which statement is true about assertion in the Java programming language?()A Assertion expressions should not contain side effects.B Assertion expression values can be any primitive type.C Assertion should be used for enforcing preconditions on public methods.D An AssertionError thrown as a result of a failed assertion should always be handled by the enclosing method.

单选题1. public class a {  2. public void method1() {  3. try {  4. B b=new b();  5. b.method2();  6. // more code here  7. } catch (TestException te) {  8. throw new RuntimeException(te);  9. }  10. }  11. }  1. public class b {  2. public void method2() throws TestException {  3. // more code here  4. }  5. }  1. public class TestException extends Exception {  2. }  Given:  31. public void method() {  32. A a=new a();  33. a.method1();  34. }  Which is true if a TestException is thrown on line 3 of class b?()A Line 33 must be called within a try block.B The exception thrown by method1 in class a is not required to be caught.C The method declared on line 31 must be declared to throw a RuntimeException.D On line 5 of class a, the call to method2 of class b does not need to be placed in a try/catch block.

多选题Which statements about static inner classes are true?()AA static inner class requires a static initializer.BA static inner class requires an instance of the enclosing class.CA static inner class has no reference to an instance of the enclosing class.DA static inner class has access to the non-static members of the outer class.EStatic members of a static inner class can be referenced using the class name of the static inner  class.

单选题public class foo {  public static void main (string[]args)  try {return;}  finally {system.out.printIn(“Finally”);}  }  What is the result?()A The program runs and prints nothing.B The program runs and prints “Finally”C The code compiles, but an exception is thrown at runtime.D The code will not compile because the catch block is missing.

单选题Which declaration prevents creating a subclass of an outer class?()A Static class FooBar{}B Private class FooBar{}C Abstract public class FooBar{}D Final public class FooBar{}E Final abstract class FooBar{}

单选题class Foo {  private int x;  publicFoo(intx) {this.x=x; }  public void setX( int x) { this.x = x; }  public int getX() { return x; }  }   public class Gamma {  static Foo fooBar( Foo foo) {  foo = new Foo( 100);  return foo;  }  public static void main( String[] args) {  Foo foo = new Foo( 300);  System.out.print( foo.getX() + “-“);  Foo fooFoo = fooBar( foo);  System.out.print( foo.getX() + “-“);  System.out.print( fooFoo.getX() + “-“);  foo = fooBar( fooFoo);  System.out.print( foo.getX() + “-“);  System.out.prmt( fooFoo.getX());  }  }  What is the output of this program?()A 300-100-100-100-100B 300-300-100-100-100C 300-300-300-100-100D 300-300-300-300-100

单选题public static void main(String[] args) {  String str = “null‟;  if (str == null) {  System.out.println(”null”);  } else (str.length() == 0) {  System.out.println(”zero”);  } else {  System.out.println(”some”);  }  }  What is the result?()A nullB zeroC someD Compilation fails.E An exception is thrown at runtime.

单选题Which statement is true?()A If only one thread is blocked in the wait method of an object, and another thread executes the modify on that same object, then the first thread immediately resumes execution.B If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, it is still possible that the first thread might never resume execution.C If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, then the first thread definitely resumes execution as a direct and sole  consequence of the notify call.D If two threads are blocked in the wait method of one object, and another thread executes the notify method on the same object, then the first thread that executed the wait call first definitely resumes execution as a direct and sole consequence of the notify call.

单选题int i = 1,j = 10;  do{  if (ij) {  continue;  }  j--;  } while (++i 6);  System.out.println(“i = “ +i+” and j = “+j);  What is the result?()A i = 6 and j = 5B i = 5 and j = 5C i = 6 and j = 4D i = 5 and j = 6E i = 6 and j = 6

单选题int x = 3;  int y = 1;  if (x = y) {  System.out.println(“x = “ + x);  }  What is the result? ()Ax=1Bx=3CCompilationensp;fails.DTheensp;codeensp;runsensp;withensp;noensp;output.ensp;EAnensp;exceptionensp;isensp;thrownensp;atensp;runtime.

多选题Which two code fragments are most likely to cause a StackOverflowError?()AABBCCDDEEFF

多选题1. class Super {  2. private int a;  3. protected Super(int a) { this.a = a; }  4. }  .....  11. class Sub extends Super {  12. public Sub(int a) { super(a); }  13. public Sub() { this.a= 5; }  14. }  Which two, independently, will allow Sub to compile?()AChange line 2 to: public int a;BChange line 2 to: protected int a;CChange line 13 to: public Sub() { this(5); }DChange line 13 to: public Sub() { super(5); }EChange line 13 to: public Sub() { super(a); }

单选题Which fragment is an example of inappropriate use of assertions? ()A assert (!(map.contains(x))); map.add(x);B if (x  0){}else { assert (x==0); }C public void aMethod(int x) { assert (x  0); }D assert (invariantCondition()); return retval;E switch (x) { case 1: break; case 2: creak; default: assert (x == 0);

单选题public class Test{  public static void main( String[] argv ){  // insert statement here  }  }   Which statement, inserted at line 3, produces the following output?()  Exception in thread “main” java.lang.AssertionError: true at Test.main(Test.java:3)A assert true;B assert false;C assert false : true;D assert false == true;E assert false: false;

单选题public class Yippee2 {  static public void main(String [] yahoo) {  for(int x= 1; xSystem.out.print(yahoo[x] + “ “);  }  }  }  and the command line invocation: java Yippee2 a b c What is the result?()Aa bBb cCa b cD Compilation fails.E An exception is thrown at runtime.

单选题10. public class ClassA {  11. public void methodA() {  12. ClassB classB = new ClassB();  13. classB.getValue();  14. }  15. }  And:  20. class ClassB {  21. public ClassC classC;  22.  23. public String getValue() {  24. return classC.getValue();  25. }  26. }  And:  30. class ClassC {  31. public String value;  32.  33. public String getValue() {  34. value = “ClassB”;  35. return value;  36. }  37. }  Given:  ClassA a = new ClassA();  a.methodA();  What is the result?()A Compilation fails.B ClassC is displayed.C The code runs with no output.D An exception is thrown at runtime.

单选题What will be the result of attempting to compile and run the following code?()   public class Q6b0c {   public static void main(String args[]) {  int i = 4;  float f = 4.3;   double d = 1.8;   int c = 0;   if (i == f) c++;   if (((int) (f + d)) == ((int) f + (int) d))  c += 2;   System.out.println(c);   }   }AThe code will fail to compile.B0 will be written to the standard output.C1 will be written to the standard output.D2 will be written to the standard output.E3 will be written to the standard output.

单选题What will be written to the standard output when the following program is run?()   public class Q63e3 {   public static void main(String args[]) {   System.out.println(9 ^ 2);   }   }A81B7C11D0Efalse