aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Java Fundamentals - Methods, Variables, and Memory Management
  • Which two are true about the objects created within main(...
Multiple choice java

Which two are true about the objects created within main(), and eligible for garbage collection when line 14 is reached?

  1. Two objects are eligible for GC

  2. Five objects were created

  3. Four objects were created.

  4. Three objects are eligible for GC

Reveal answer Fill a bubble to check yourself
A,B Correct answer

Keep practicing — related questions

  • An object becomes eligible for Garbage Collection when there are very few threads that can access it.
  • class C { public static void main(String a[]) { C c1=new C(); C c2=m1(c1); C c3=new C(); c2=c3; //6 another...
  • class X2 { public X2 x; public static void main(String [] args) { X2 x2 = new X2(); /* Line 6 */ X2 x3 = ne...
  • public class X { public static void main(String [] args) { X x = new X(); X x2 = m1(x); /* Line 6 */ X x4 =...
  • Which statement is true?
  • void start() { A a = new A(); B b = new B(); a.s(b); b = null; /* Line 5 */ a = null; /* Line 6 */ System.o...
  • A garbage collected object can be reached again.
  • class Test { private Demo d; void start() { d = new Demo(); this.takeDemo(d); /* Line 7 */ } /* Line 8 */ v...
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Object-Oriented Programming (2239 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy