SCJP 5.0(75%), SCWCD 5.0(88%)
SCJP 5.0(75%), SCWCD 5.0(88%)
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Originally posted by Dean Jones:
.. then the object initially referenced by c2 is eligible and vice-versa.
Am I right?
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
As per Dean
Here, c1.z =c2 and c2.z=c1. If c1 and c2 point to the obj referenced by c3 what happens to c1.z and c2.z. Can someone please explain.
c1 is : [8567361], c1.z = null
c2 is : [9584176], c2.z = null
(2) c1 is : [8567361], c1.z = [9584176]
(2) c2 is : [9584176], c2.z = [8567361]
c3 is : [19972507], c3.z = null
c4 which is now c1.z i.e c1 ref variable z is [9584176]
c5 which is now c2.z i.e c2 ref variable z is [8567361]
c4 after reassigning of c1 to c3 [9584176]
c5 after reassigning of c2 to c3 [8567361]
(3) c1 is : [19972507], c1.z = null
(3) c2 is : [19972507], c2.z = null
From the Garbage Collector chapter in K & B's book:
If our Java program has a reference variable that refers to
an object, and that reference variable is available to a live thread, then that object is considered reachable.
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
As per the statement given in K & B's book, i am now confused here on the object pointed by C2 here!. As such, it seems like it is still reachable via c1.z which is reachable via c3.z that is available to the active thread. As Dean Jones has initially pointed out. I guess it is still reachable only.
Originally posted by sweta doshi:
Hello ,
Does the above mean as follows :
1. c3.other(c1) (so ..c3.z=c1.z=c2...so c3.z=c2)
2. c1=c3 (so c1.z=c3.z=c2)
3. c2=c3 (so c2.z=c3.z=c2 !)
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Originally posted by Raghavan:
As per the statement given in K & B's book, i am now confused here on the object pointed by C2 here!. As such, it seems like it is still reachable via c1.z which is reachable via c3.z that is available to the active thread. As Dean Jones has initially pointed out. I guess it is still reachable only.
c1 is : [8567361], c1.z = null
c2 is : [9584176], c2.z = null
(2) c1 is : [8567361], c1.z = [9584176]
(2) c2 is : [9584176], c2.z = [8567361]
c3 is : [19972507], c3.z = null
c4 which is now c1.z i.e c1 ref variable z is [9584176]
c5 which is now c2.z i.e c2 ref variable z is [8567361]
c3's Z[19972507], c3.z = [8567361]
c5's Z is now refering to the object2 which was initially referred by C2 c5.z= [9584176]
c4 after reassigning of c1 to c3 [9584176]
c5 after reassigning of c2 to c3 [8567361]
(3) c1 is : [19972507], c1.z = [19972507]
(3) c2 is : [19972507], c2.z = [19972507]
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Originally posted by Bert Bates:
...Great job Raghavan!
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
On top of spaghetti all covered in cheese, there was this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|