1. public Object m() { Object o = new Float(3.14F); Object [] oa = new Object[l]; oa[0] = o; / Line 5 / o = null; / Line 6 / oa[0] = null; / Line 7 / return o; / Line 8 / } When is the Float object, created in line 3, eligible for garbage collection?





Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 02 Jun 2017 01.26 am
    Option A is wrong. This simply copies the object reference into the array. Option B is wrong. The reference o is set to null, but, oa[0] still maintains the reference to the Float object. Option C is correct. The thread of execution will then not have access to the object.
Show Similar Question And Answers
QA->Eligible (adj.)....
QA->Null and void....
QA->Age group of the people who were eligible under the `TRYSEM` system?....
QA->A process in which a public relations representative sends out press releases to various media outlets to promote a company change, a new product or a new service is known as....
QA->The Shortcut key to start a new line without starting a new paragraph is....
MCQ->public Object m() { Object o = new Float(3.14F); Object [] oa = new Object[l]; oa[0] = o; / Line 5 / o = null; / Line 6 / oa[0] = null; / Line 7 / return o; / Line 8 / } When is the Float object, created in line 3, eligible for garbage collection?....
MCQ->void start() { A a = new A(); B b = new B(); a.s(b); b = null; / Line 5 / a = null; / Line 6 / System.out.println("start completed"); / Line 7 / } When is the B object, created in line 3, eligible for garbage collection?....
MCQ->class Bar { } class Test { Bar doBar() { Bar b = new Bar(); / Line 6 / return b; / Line 7 / } public static void main (String args[]) { Test t = new Test(); / Line 11 / Bar newBar = t.doBar(); / Line 12 / System.out.println("newBar"); newBar = new Bar(); / Line 14 / System.out.println("finishing"); / Line 15 / } } At what point is the Bar object, created on line 6, eligible for garbage collection?....
MCQ->Which two cause a compiler error? float[ ] f = new float(3); float f2[ ] = new float[ ]; float[ ]f1 = new float[3]; float f3[ ] = new float[3]; float f5[ ] = {1.0f, 2.0f, 2.0f};....
MCQ->What will be the output of the following program? #include<iostream.h> int main() { float Amount; float Calculate(float P = 5.0, int N = 2, float R = 2.0); Amount = Calculate(); cout<< Amount << endl; return 0; } float Calculate(float P, int N, float R) { int Year = 1; float Sum = 1 ; Sum = Sum (1 + P ++N R); Year = (int)(Year + Sum); return Year; }....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution