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

相关考题:

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

以下( )不是Object类的方法A)clone()B)finalize()C)toString()D)hasNext()

Java语言有自动收集垃圾功能,周期性的回收一些长期不用的对象占用的内存。下列哪些是对象的清除的途径? ①依靠Java的垃圾回收机制回收内存 ②调用System.gc( ),请求垃圾回收 ③Java系统开始运行时,自动调用java.lang.Object.finalize( )释放内存 ④在程序中调用重写的finalize( )释放系统资源,其格式为: protected void finalize( )throws throwable { … super.finalize( ); }A.①③B.①②③④C.①②③D.②③④

定义一个类名为MyClass的类,并且该类可被所有类访问,那么该类的正确声明应为()A、private class MyClass extends ObjectB、class MyClass extends ObjectC、public class MyClassD、protected class MyClass extends Object

在JAVA中,Object类是所有类的父亲,用户自定义类默认扩展自Object类,下列选项中的( )方法不属于Object类的方法。A、equals(Objectobj)B、getClass()C、toString()D、trim()

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

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

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

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.

以下关于Java中类声明和方法声明的叙述中,不正确的是()。A、在类的内部可以再声明类,即Java中允许嵌套进行类声明B、在方法的内部可以再声明方法C、类的成员变量的所属类型可以是Java中的任意合法类型D、方法的局部变量的所属类型可以是Java中的任意合法类型

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

在JAVA中,Object类是所有类的父亲,用户自定义类默认扩展自Object类,下列选项中的()方法不属于Object类的方法。A、equals(Object obj)B、getClass()C、toString()D、trim()

Object类中的()方法不能被覆写。A、toString()B、getClass()C、clone()D、finalize()

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

如果你设计了一个类,并且覆盖了equals( )方法,哪些方法你还会考虑覆盖()A、clone()B、toString()C、wait()D、finalize()E、hashCode()

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.

如果要为对象回收做收尾操作,则应该覆写Object类中的()方法。A、toString()B、getClass()C、clone()D、finalize()

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

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.

单选题在php5中如何让类中的某些方法无法在类的外部被访问?()A把类声明为privateB把方法声明为privateC无法实现D编写合适的重载方法(overloadingmethoD.

多选题Which two are true?()AA finalizer may NOT be invoked explicitly.BThe finalize method declared in class Object takes no action.Csuper.finalize()is called implicitly by any over riding finalize method.DThe finalize method for a given objec twill be called no more than once by the garbage collector.EThe order in which finalize will be called on two objects is based on the order in which the two objects became finalizable.

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

单选题Which statement is true?()AA class’s finalize() method CANNOT be invoked explicitly.Bsuper.finalize() is called implicitly by any overriding finalize() method.CThe finalize() method for a given object is called no more than once by the garbage collector.DThe order in which finalize() is called on two objects is based on the order in which the two objects became finalizable.

单选题你开发了一个基于Windows的应用程序,该应用程序包含一个名为TestKingContact的类。TestKingContact使用ADO.NET连接MicrosoftSQLServer数据库。当TestKingContact在运行的时候需要一个活动连接连到数据库。你要确保当TestKingContact结束运行时它所使用的所有资源都被释放掉。你该怎么做?()A在连接状态,创建一个子程序名为Finalize去覆盖System.Object.Finalize。B在连接状态,创建一个子程序名为Closed。在这个程序中加入适当的清除代码。C在IDisposable接口中实现Dispose方法。在Dispose方法中加入适当的清除代码.在释放掉引用之前调用Dispose方法。D实现Finalize方法,在Finalize方法中加入适当的清除代码。释放掉引用之前调用Dispose方法。

单选题Object类的finalize()方法是如何声明的()。Apublic void finalize()Bprotected int finalize()CC.protected void finalize(intDprotected void finalize()throws Throwable

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

多选题Which statements describe guaranteed behavior of the garbage collection and finalization mechanisms?()AObjects are deleted when they can no longer be accessed through any reference.BThe finalize() method will eventually be called on every object.CThe finalize() method will never be called more than once on an object.DAn 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.EThe garbage collector will use a mark and sweep algorithm.

单选题以下关于Java中类声明和方法声明的叙述中,不正确的是()。A在类的内部可以再声明类,即Java中允许嵌套进行类声明B在方法的内部可以再声明方法C类的成员变量的所属类型可以是Java中的任意合法类型D方法的局部变量的所属类型可以是Java中的任意合法类型