Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Ahmad Hamdan

Greenhorn
+ Follow
since Aug 04, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ahmad Hamdan

Leonardo i still don't understand
i know 'd' is a refernce variable but its refering to null so why isn't it eligible for the garbage collection?

and thanks avi for the advice
There is this question in chapter 3 of scjp 6 study guide book

The question is:
which are true about objects created in the main() and eligible for Garbage Collection:

class Dozens{
int[] dz={1,2,3,4,5,6,7,8,9,10,11,12};
}
public class Eggs{
public static void main(String[] args){
Dozens[] da= new Dozens[3];
da[0]=new Dozens();
Dozens d=new Dozens();
da[1]=d;
d=null;
da[1]=null;
//line 14
}
}


In the book the answers are five objects are created and this i understand and the other answer is two objects are eligible for the GC
In the explanation it says the two objects are da[1] and it array which is dz.

what i don't understand is why isn't Object 'd' included in the GC because i see it referenced to null
hi there can any one help me on how to write an arabic text using a random access file i know how to do it with a BufferedWriter by settin the charset to utf-8 but the proplem is how to do it with ar RandomAccessFile
13 years ago