IndiaBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning Non Verbal Reasoning
General Knowledge
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming C++ Programming C# Programming Java Programming
Microbiology Biochemistry Biotechnology Biochemical Engineering
Chemical Engineering Networking Database Questions Computer Science Basic Electronics Digital Electronics Electronic Devices Circuit Simulation Electrical Enigneering Engineering Mechanics Technical Drawing
Placement Papers Group Disucssion HR Interview Technical Interview Body Language
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test Data Interpretation Test General Knowledge Test
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt C Interview Questions The C Language Basics .NET Interview Questions .NET Framework ADO.NET ASP.NET Software Testing

Java Programming - Garbage Collections

@ : Home > Java Programming > Garbage Collections > Pointing out the correct statements

Exercise

"Nothing is impossible to a willing heart."
- (Proverb)
1. 

Which statement is true?

A. Programs will not run out of memory.
B. Objects that will never again be used are eligible for garbage collection.
C. Objects that are referred to by other objects will never be garbage collected.
D. Objects that can be reached from a live thread will never be garbage collected.

2. 

Which statement is true?

A. All objects that are eligible for garbage collection will be garbage collected by the garbage collector.
B. Objects with at least one reference will never be garbage collected.
C. Objects from a class with the finalize() method overridden will never be garbage collected.
D. Objects instantiated within anonymous inner classes are placed in the garbage collectible heap.

3. 

Which statement is true?

A. Memory is reclaimed by calling Runtime.gc().
B. Objects are not collected if they are accessible from live threads.
C. An OutOfMemory error is only thrown if a single block of memory cannot be found that is large enough for a particular requirement.
D. Objects that have finalize() methods always have their finalize() methods called before the program ends.

4. 

Which statement is true?

A. Calling Runtime.gc() will cause eligible objects to be garbage collected.
B. The garbage collector uses a mark and sweep algorithm.
C. If an object can be accessed from a live thread, it can't be garbage collected.
D. If object 1 refers to object 2, then object 2 can't be garbage collected.


© 2008-2012 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy

Contact us: info@indiabix.com     Follow us on twitter!