publicclassX{publicobjectm(){objecto=newfloat(3.14F);objectoa=newobject[1];oa[0]=o;o=null;returnoa[0];}}Whenisthefloatobjectcreatedinline3,eligibleforgarbagecollection?() A.Justafterline5B.Justafterline6C.Justafterline7(thatis,asthemethodreturns)D.Neverinthismethod.

publicclassX{publicobjectm(){objecto=newfloat(3.14F);objectoa=newobject[1];oa[0]=o;o=null;returnoa[0];}}Whenisthefloatobjectcreatedinline3,eligibleforgarbagecollection?()

A.Justafterline5

B.Justafterline6

C.Justafterline7(thatis,asthemethodreturns)

D.Neverinthismethod.


相关考题:

Whichthreewillcompileandrunwithoutexception?() A.privatesynchronizedObjecto;B.voidgo(){synchronized(){/*codehere*/}C.publicsynchronizedvoidgo(){/*codehere*/}D.privatesynchronized(this)voidgo(){/*codehere*/}E.voidgo(){synchronized(Object.class){/*codehere*/}F.voidgo(){Objecto=newObject();synchronized(o){/*codehere*/}

1.public class GC{2.private Objec to;3.private void doSomethingElse(Object obj){o=obj;}4.public void doSomething(){5.Object o=new Object();6.doSomethingElse(o);7.o=new Object();8.doSomethingElse(null);9.o=null;10.}11.}When the doSomething method is called,after which line does the Object created in line 5 become available for garbage collection?()A.Line5B.Line6C.Line7D.Line8E.Line9F.Line10

Whichthreewillcompileandrimwithoutexception?() A.privatesynchronizedObjecto;B.voidgo(){synchronized(){/*codehere*/}}C.publicsynchronizedvoidgo(){/*codehere*/}D.privatesynchronized(this)voidgo(){/*codehere*/}E.voidgo(){synchronized(Object.class){/*codehere*/}}F.voidgo(){Objecto=newObject();synchronized(o){/*codehere*/}}

publicclassX{2.publicobjectm(){3.objecto=newfloat(3.14F);4.object[]oa=newobject[1];5.oa[0]=o;6.o=null;7.oa[0]=null;10.returno;9.}10.}Whenisthefloatobjectcreatedinline3,eligibleforgarbagecollection?() A.Justafterline5.B.Justafterline6.C.Justafterline7.D.Justafterline8(thatis,asthemethodreturns).

publicclassX(2.publicobjectm(){3.objecto=newfloat(3.14F);4.object[]oa=newobject[1];5.oa[0]=o;6.o=null;7.returnoa[0];8.}9.}Whenisthefloatobjectcreatedinline3,eligibleforgarbagecollection?() A.Justafterline5B.Justafterline6C.Justafterline7(thatis,asthemethodreturns)D.Neverinthismethod.

publicObjectm(){11.Objecto=newFloat(3.14F);12.Object[]oa=newObject[1];13.oa[0]=o;14.o=null;15.returnoa[0];16.}WhenistheFloatobject,createdinline11,eligibleforgarbagecollection?() A.Justafterline13.B.Justafterline14.C.Neverinthismethod.D.Justafterline15(thatis,asthemethodreturns).

publicclassX{publicobjectm(){objecto=newfloat(3.14F);objectoa=newobject[1];oa[0]=o;o=null;oa[0]=null;returno;}}Whenisthefloatobjectcreatedinline3,eligibleforgarbagecollection?() A.Justafterline5.B.Justafterline6.C.Justafterline7.D.Justafterline8(thatis,asthemethodreturns).

在下列代码中,有()处实现了拆箱。 int score=5; object o= score; o=10; score =(int)o; object oScore = score;A.0B.1C.2D.3

下面的程序会抛出什么异常类型? public class Test { public static void main(String[] args) { Object o = new Object(); String d = (String)o; } }A.ArithmeticExceptionB.ArrayIndexOutOfBoundsExceptionC.StringIndexOutOfBoundsExceptionD.ClassCastException