单选题Which statement is true?()A A class’s finalize() method CANNOT be invoked explicitly.B super.finalize() is called implicitly by any overriding finalize() method.C The finalize() method for a given object is called no more than once by the garbage colle

题目
单选题
Which statement is true?()
A

A class’s finalize() method CANNOT be invoked explicitly.

B

super.finalize() is called implicitly by any overriding finalize() method.

C

The finalize() method for a given object is called no more than once by the garbage collector.

D

The order in which finalize() is called on two objects is based on the order in which the two objects became finalizable.


相似考题
更多“单选题Which statement is true?()A A class’s finalize() method CANNOT be invoked explicitly.B super.finalize() is called implicitly by any overriding finalize() method.C The finalize() method for a given object is called no more than once by the garbage colle”相关问题
  • 第1题:

    Under what two circumstances is the set JspBody method NOT called in a tag class that implements the Simple Tag interface? ()

    • A、 The tag is invoked without a body.
    • B、 The doTAb method throws an exception.
    • C、 The  element has the value empty.
    • D、 The tag is called with the attribute skip-body=true

    正确答案:A,C

  • 第2题:

    Object类的finalize()方法是如何声明的()。

    • A、public void finalize()
    • B、protected int finalize()
    • C、C.protected void finalize(int
    • D、protected void finalize()throws Throwable

    正确答案:D

  • 第3题:

    Which statements describe guaranteed behavior of the garbage collection and finalization mechanisms?()  

    • A、Objects are deleted when they can no longer be accessed through any reference.
    • B、The finalize() method will eventually be called on every object.
    • C、The finalize() method will never be called more than once on an object.
    • D、An object will not be garbage collected as long as it is possible for an active part of the program to      access it through a reference.
    • E、The garbage collector will use a mark and sweep algorithm.

    正确答案:C,D

  • 第4题:

    Which statement is true if the doStartTag method returns EVAL_BODY_BUFFERED?()

    • A、The tag handler must implement BodyTag.
    • B、The doAfterBody method is NOT called.
    • C、The setBodyContent method is called once.
    • D、It is never legal to return EVAL_BODY_BUFFERED from doStartTag.

    正确答案:C

  • 第5题:

    Which methods from the String and StringBuffer classes modify the object on which they are called?()  

    • A、The charAt() method of the String class.
    • B、The toUpperCase() method of the String class.
    • C、The replace() method of the String class.
    • D、The reverse() method of the StringBuffer class.
    • E、The length() method of the StringBuffer class.

    正确答案:D

  • 第6题:

    Which statement is true?()

    • A、A class’s finalize() method CANNOT be invoked explicitly.
    • B、super.finalize() is called implicitly by any overriding finalize() method.
    • C、The finalize() method for a given object is called no more than once by the garbage collector.
    • D、The order in which finalize() is called on two objects is based on the order in which the two objects became finalizable.

    正确答案:C

  • 第7题:

    Which two statements are true about the hashCode method?()

    • A、The hashCode method for a given class can be used to test for object equality and object inequality for that class.
    • B、The hashCode method is used by the java.util.SortedSet collection class to order the elements within that set.
    • C、The hashCode method for a given class can be used to test for object inequality, but NOT objecte quality, for that class.
    • D、The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.
    • E、The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.

    正确答案:C,E

  • 第8题:

    多选题
    Which statements concerning the methods notify() and notifyAll() are true?
    A

    Instances of class Thread have a method called notify().

    B

    A call to the method notify() will wake the thread that currently owns the monitor of the object.

    C

    The method notify() is synchronized.

    D

    The method notifyAll() is defined in class Thread.

    E

    When there is more than one thread waiting to obtain the monitor of an object, there is no way to be     sure which thread will be notified by the notify() method.


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

  • 第9题:

    单选题
    Which statement is true if the doStartTag method returns EVAL_BODY_BUFFERED?()
    A

    The tag handler must implement BodyTag.

    B

    The doAfterBody method is NOT called.

    C

    The setBodyContent method is called once.

    D

    It is never legal to return EVAL_BODY_BUFFERED from doStartTag.


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

  • 第10题:

    多选题
    Which statements describe guaranteed behavior of the garbage collection and finalization mechanisms?()
    A

    Objects are deleted when they can no longer be accessed through any reference.

    B

    The finalize() method will eventually be called on every object.

    C

    The finalize() method will never be called more than once on an object.

    D

    An object will not be garbage collected as long as it is possible for an active part of the program to      access it through a reference.

    E

    The garbage collector will use a mark and sweep algorithm.


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

  • 第11题:

    单选题
    Click the Exhibit button. Given: Which statement 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 method 1 in class A is not required to be caught.

    C

    The method declared on line 31 must be declared to throw a runtime exception.

    D

    On line 5 of class A,the call to method 2 of class B does not need to be placed in a try catch block.


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

  • 第12题:

    多选题
    Under what two circumstances is the set JspBody method NOT called in a tag class that implements the Simple Tag interface? ()
    A

    The tag is invoked without a body.

    B

    The doTAb method throws an exception.

    C

    The  element has the value empty.

    D

    The tag is called with the attribute skip-body=true


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

  • 第13题:

    Which two are true?()

    • A、A finalizer may NOT be invoked explicitly.
    • B、The finalize method declared in class Object takes no action.
    • C、super.finalize()is called implicitly by any over riding finalize method.
    • D、The finalize method for a given objec twill be called no more than once by the garbage collector.
    • E、The order in which finalize will be called on two objects is based on the order in which the two objects became finalizable.

    正确答案:B,D

  • 第14题:

    Which statements concerning the methods notify() and notifyAll() are true?  

    • A、Instances of class Thread have a method called notify().
    • B、A call to the method notify() will wake the thread that currently owns the monitor of the object.
    • C、The method notify() is synchronized.
    • D、The method notifyAll() is defined in class Thread.
    • E、When there is more than one thread waiting to obtain the monitor of an object, there is no way to be     sure which thread will be notified by the notify() method.

    正确答案:A,E

  • 第15题:

    Under which circumstances will a thread stop?()  

    • A、The method waitforId() in class MediaTracker is called.
    • B、The run() method that the thread is executing ends.
    • C、The call to the start() method of the Thread object returns.
    • D、The suspend() method is called on the Thread object.
    • E、The wait() method is called on the Thread object.

    正确答案:B

  • 第16题:

    Which of the following statements about variables and scope are true?() 

    • A、 Local variables defined inside a method are destroyed when the method is exited.
    • B、 Local variables are also called automatic variables.
    • C、 Variables defined outside a method are created when the object is constructed.
    • D、 A method parameter variable continues to exist for as long as the object is needed in which the method is defined.

    正确答案:A,B,C

  • 第17题:

    Which two statements are true about using the isUserInRole method to implement security in a Java EEapplication?()

    • A、It can be invoked only from the doGet or doPost methods.
    • B、It can be used independently of the getRemoteUser method.
    • C、Can return "true" even when its argument is NOT defined as a valid role name in the deployment descriptor.
    • D、Using the isUserInRole method overrides any declarative authentication related to the method in which it is invoked.

    正确答案:B,C

  • 第18题:

    Which three statements are true?()

    • A、A final method in class X can be abstract if and only if X is abstract.
    • B、A protected method in class X can be overridden by any subclass of X.
    • C、A private static method can be called only within other static methods in class X.
    • D、A non-static public final method in class X can be overridden in any subclass of X.
    • E、A public static method in class X can be called by a subclass of X without explicitly referencing the class X.
    • F、A method with the same signature as a private final method in class X can be implemented in a subclass of X.
    • G、A protected method in class X can be overridden by a subclass of X only if the subclass is in the same package as X.

    正确答案:B,E,F

  • 第19题:

    单选题
    Under which circumstances will a thread stop?()
    A

    The method waitforId() in class MediaTracker is called.

    B

    The run() method that the thread is executing ends.

    C

    The call to the start() method of the Thread object returns.

    D

    The suspend() method is called on the Thread object.

    E

    The wait() method is called on the Thread object.


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

  • 第20题:

    单选题
    Which statement is true?()
    A

    A class’s finalize() method CANNOT be invoked explicitly.

    B

    super.finalize() is called implicitly by any overriding finalize() method.

    C

    The finalize() method for a given object is called no more than once by the garbage collector.

    D

    The order in which finalize() is called on two objects is based on the order in which the two objects became finalizable.


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

  • 第21题:

    多选题
    Which two statements are true about the hashCode method?()
    A

    The hashCode method for a given class can be used to test for object equality and object inequality for that class.

    B

    The hashCode method is used by the java.util.SortedSet collection class to order theelements within that set.

    C

    The hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.

    D

    The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.

    E

    The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.


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

  • 第22题:

    单选题
    Object类的finalize()方法是如何声明的()。
    A

    public void finalize()

    B

    protected int finalize()

    C

    C.protected void finalize(int

    D

    protected void finalize()throws Throwable


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

  • 第23题:

    单选题
    Which methods from the String and StringBuffer classes modify the object on which they are called?()
    A

    The charAt() method of the String class.

    B

    The toUpperCase() method of the String class.

    C

    The replace() method of the String class.

    D

    The reverse() method of the StringBuffer class.

    E

    The length() method of the StringBuffer class.


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

  • 第24题:

    多选题
    Given: 6. 7. 8. and a custom tag handler for foo which extends TagSupport. Which two are true about thetag handler referenced by foo?()
    A

    The doStartTag method is called once.

    B

    The doAfterBody method is NOT called.

    C

    The EVAL_PAGE constant is a valid return value for the doEndTag method.

    D

    The SKIP_PAGE constant is a valid return value for the doStartTag method.

    E

    The EVAL_BODY_BUFFERED constant is a valid return value for the doStartTag method.


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