rahul mishra


{ City } bangalore
< Country > india
* Profession * software developer
User No # 117183
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 0
Users Marked my Answers as Wrong # 0
Questions / { rahul mishra }
Questions Answers Category Views Company eMail




Answers / { rahul mishra }

Question { Infosys, 74627 }

What is garbage collection in Java, and how can it be used ?


Answer

1>Garbage collection is a deamon thread which runs at the background to support the nin deamon thread.
2>garbage collector is responsible to destroy the useless objects.
3>An obejct is eligible for GC if and only if it doesn;t have any reference.
4>we can also call GC explicitly by System Class and Runtime class
By System Class:
- System.gc();
By Runtime Class
-Runtime r = Runtime.getRuntime(); (here we are creating runtime object by using factory method)
now, you can call gc() method
-r.gc();

Is This Answer Correct ?    0 Yes 0 No

Question { TCS, 12435 }

Howmany number of objects we can store in an ArrayList. Is
there any limit?


Answer

It depends on list implementation.Since ArrayList is backed by an arrays so its size is limited to Integer.MAX_VALUE
and it can't hold more than interger.MAX_VALUE.

Is This Answer Correct ?    0 Yes 0 No