Raymond Chamberglain

Greenhorn
+ Follow
since Jun 14, 2009
Merit badge: grant badges
For More
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 Raymond Chamberglain

Anyone has any suggestions to which mock exams to take when time is limited? Appreciate it.
I'm sorry. The source is the 'Sun Certified Programmer for Java 6 Study Guide' by Kathy Sierra and Bert Bates.
So '@bf73fa' is a String representation to the array element?
The answer is 2, but I don't know where one of them comes from.

From what I understand, there are 2 cardboard objects and 2 Short wrapper objects (created when the two cardboard objects are initialized. Let's call cardboard initialized to c1 is A and the other B.
by the time // dostuff is reached, c1 and c3 is null. since c1 is null, cardboard A has no more references referring it. c2 is still referring to cardboard B, because go() method doesn't use the c2, instead it creates a copy of the c2 variable. However the cb variable in go() method is referring to cardboard B. Regardless, cb is null when // dostuff is reached.

So it goes like this:

c1 -> cardboard A.
c2, cb -> cardboard B.
c3 -> null

When // dostuff is reached, c1 and cb becomes null. But c2 still exist. So cardboard A and its Short wrapper is eligible for GC. Is this the right explanation? Sorry that I kinda go around in circles. I am still trying to sort my thoughts. lol..
oh yeah.. that's right.. GC is collecting objects not variables. duh!!

Thanks much!!
When we initialize an array of objects (or object references, I think), the elements would be of value null right? Are they eligible for garbage collection? I would think not, but I thought I better ask than assume. Thanks much!
I am completely confused with this question. Where in the world is the getBidValue(3) method (line 11)? Also some things I want to clarify some things. One of the answers say 'The output could contain @bf73fa'. What is that number? Is it the bit representation of an array object? Then Suits.SPADES.points can be accessed? So private members can be accessed by anything within the class, am I correct? Thank you for the help!!

I'm confused with the answer to this question. This question is question one from chapter 3's self test section. It asks that when '// do stuff' is reached, how many objects are eligible for GC?



I know c2 is not null because it is referencing to a CardBoard object. c3 is referencing to the cb reference variable (Is this correct?). c1 is null. But how does the Short wrapper object becomes eligible for GC? The answer says "it has an associated Short wrapper object that is also eligible." what is 'it'? c1? Please help.. My mind is doing an infinite loop and about to blow up the stack.. :P Thanks.