Object类的finalize()方法是如何声明的()。A、public void finalize()B、protected int finalize()C、C.protected void finalize(intD、protected void finalize()throws Throwable

题目

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

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

相似考题
更多“Object类的finalize()方法是如何声明的()。”相关问题
  • 第1题:

    在JAVA中,Object类是所有类的父亲,用户自定义类默认扩展自Object类,下列选项中的( )方法不属于Object类的方法。

    A、equals(Objectobj)

    B、getClass()

    C、toString()

    D、trim()


    正确答案:D

  • 第2题:

    声明一个基类与声明一个普通类的方法是一样的。()


    正确答案:错误

  • 第3题:

    What allows the programmer to destroy an object x?()  

    • A、 x.delete()
    • B、 x.finalize()
    • C、 Runtime.getRuntime().gc()
    • D、 Explicitly setting the object’s reference to null.
    • E、 Ensuring there are no references to the object.
    • F、 Only the garbage collection system can destroy an object.

    正确答案:F

  • 第4题:

    在声明成员方法的时候,用关键字static修饰的方法是类方法,类方法也称为()方法。


    正确答案:静态

  • 第5题:

    Object类中的()方法不能被覆写。

    • A、toString()
    • B、getClass()
    • C、clone()
    • D、finalize()

    正确答案:B

  • 第6题:

    如果你设计了一个类,并且覆盖了equals( )方法,哪些方法你还会考虑覆盖()

    • A、clone()
    • B、toString()
    • C、wait()
    • D、finalize()
    • E、hashCode()

    正确答案:E

  • 第7题:

    如果要为对象回收做收尾操作,则应该覆写Object类中的()方法。

    • A、toString()
    • B、getClass()
    • C、clone()
    • D、finalize()

    正确答案:D

  • 第8题:

    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

  • 第9题:

    多选题
    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,C
    解析: 暂无解析

  • 第10题:

    单选题
    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
    解析: 暂无解析

  • 第11题:

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

    public void finalize()

    B

    protected int finalize()

    C

    C.protected void finalize(int

    D

    protected void finalize()throws Throwable


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

  • 第12题:

    多选题
    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,D
    解析: 暂无解析

  • 第13题:

    如果一个类的声明中没有使用extends关键字,这个类被系统默认为是Object的直接子类。()

    此题为判断题(对,错)。


    答案:对

  • 第14题:

    final,finally,finalize三个关键字的区别有()。 

    • A、final是修饰符(关键字)可以修饰类、变量、方法
    • B、finally在异常处理时使用,提供finally块来执行任何清除操作
    • C、finalize是方法名,在垃圾收集器将对象从内存中清除出去之前做必要的清理工作
    • D、final和finalize一样都是用于异常处理的方法

    正确答案:A,B,C

  • 第15题:

    以下关于Java中类声明和方法声明的叙述中,不正确的是()。

    • A、在类的内部可以再声明类,即Java中允许嵌套进行类声明
    • B、在方法的内部可以再声明方法
    • C、类的成员变量的所属类型可以是Java中的任意合法类型
    • D、方法的局部变量的所属类型可以是Java中的任意合法类型

    正确答案:B

  • 第16题:

    在JAVA中,Object类是所有类的父亲,用户自定义类默认扩展自Object类,下列选项中的()方法不属于Object类的方法。

    • A、equals(Object obj)
    • B、getClass()
    • C、toString()
    • D、trim()

    正确答案:D

  • 第17题:

    关于 Object 类说法不正确的是()

    • A、Object 类是所有类的顶级父类
    • B、Object 对象类定义在 java.util 包
    • C、在 Java 体系中,所有类都直接或间接的继承了 Object 类
    • D、任何类型的对象都可以赋给 Object 类型的变量

    正确答案:B

  • 第18题:

    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

  • 第19题:

    final、finally和finalize的区别中,下述说法正确的有()。

    • A、final用于声明属性,方法和类,分别表示属性不可变,方法不可覆盖,类不可继承
    • B、finally是异常处理语句结构的一部分,表示总是执行
    • C、finalize是Object类的一个方法,在垃圾收集器执行的时候会调用被回收对象的此方法,可以覆盖此方法提供垃圾收集时的其他资源的回收,例如关闭文件等
    • D、引用变量被final修饰之后,不能再指向其他对象,它指向的对象的内容也是不可变的

    正确答案:A,B,C

  • 第20题:

    单选题
    在php5中如何让类中的某些方法无法在类的外部被访问?()
    A

    把类声明为private

    B

    把方法声明为private

    C

    无法实现

    D

    编写合适的重载方法(overloadingmethoD.


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

  • 第21题:

    单选题
    What allows the programmer to destroy an object x?()
    A

     x.delete()

    B

     x.finalize()

    C

     Runtime.getRuntime().gc()

    D

     Explicitly setting the object’s reference to null.

    E

     Ensuring there are no references to the object.

    F

     Only the garbage collection system can destroy an object.


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

  • 第22题:

    单选题
    你开发了一个基于Windows的应用程序,该应用程序包含一个名为TestKingContact的类。TestKingContact使用ADO.NET连接MicrosoftSQLServer数据库。当TestKingContact在运行的时候需要一个活动连接连到数据库。你要确保当TestKingContact结束运行时它所使用的所有资源都被释放掉。你该怎么做?()
    A

    在连接状态,创建一个子程序名为Finalize去覆盖System.Object.Finalize。

    B

    在连接状态,创建一个子程序名为Closed。在这个程序中加入适当的清除代码。

    C

    在IDisposable接口中实现Dispose方法。在Dispose方法中加入适当的清除代码.在释放掉引用之前调用Dispose方法。

    D

    实现Finalize方法,在Finalize方法中加入适当的清除代码。释放掉引用之前调用Dispose方法。


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

  • 第23题:

    多选题
    final、finally和finalize的区别中,下述说法正确的有()。
    A

    final用于声明属性,方法和类,分别表示属性不可变,方法不可覆盖,类不可继承

    B

    finally是异常处理语句结构的一部分,表示总是执行

    C

    finalize是Object类的一个方法,在垃圾收集器执行的时候会调用被回收对象的此方法,可以覆盖此方法提供垃圾收集时的其他资源的回收,例如关闭文件等

    D

    引用变量被final修饰之后,不能再指向其他对象,它指向的对象的内容也是不可变的


    正确答案: C,B
    解析: 使用 final 关键字修饰一个变量时,是指引用变量不能变,引用变量所指向的对象中的内容还是可以改变的

  • 第24题:

    单选题
    以下关于Java中类声明和方法声明的叙述中,不正确的是()。
    A

    在类的内部可以再声明类,即Java中允许嵌套进行类声明

    B

    在方法的内部可以再声明方法

    C

    类的成员变量的所属类型可以是Java中的任意合法类型

    D

    方法的局部变量的所属类型可以是Java中的任意合法类型


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