SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Harikrishna Gorrepati wrote:Question 1 : Line # 13 passing passing c2 object reference to Line # 4 and we are making it null at Line 5. So c2 also shold be null right because it is pas by reference ?
Harikrishna Gorrepati wrote:
Questions 2 : What if we change Line 3 to short story = 200 ?
Harikrishna Gorrepati wrote:
Question 3 : What if we change Line 3 to Short story; ?
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Harikrishna Gorrepati wrote:
Question 1 : Line # 13 passing passing c2 object reference to Line # 4 and we are making it null at Line 5. So c2 also shold be null right because it is pas by reference ?
Harikrishna Gorrepati wrote:Hi Abimaran, I am not clear for Question 1. Could you please elaborate and explain in simple terms..
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Harikrishna Gorrepati wrote:
My Question is Line # 13 passing passing c2 object reference to Line # 4 and we are making c2 object reference null at Line 5. So c2 also should be null because it is pass by reference ? Please correct me if I am going wrong.
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Harikrishna Gorrepati wrote:Yes. c2 hold same bit pattern. but we made it null at Line 5. So c2 at Line 12 also should be null know ??
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Harikrishna Gorrepati wrote:
I am completely lost![]()
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
So c2 at Line 12 also should be null because it is pass by reference.
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Harikrishna Gorrepati wrote:Hi Ankit, I have gone through this couple of times and can differentiate Pass by value and Pass by reference. Still I fee that, Line # 13 passing passing c2 object reference to Line # 4 and we are making c2 object reference null at Line 5. So c2 at Line 12 also should be null because it is pass by reference. If c2 was a primitive datatype, Line 12 wouldn't be null. Please advice
before call: 7
go():i : 7
go():x : 4
go():i : 4
after call: 7
OCPJP-6
OCWCD-6
David G Harris wrote:Here's the question and answer from the Self-Test
When //do stuff is reached, how many objects are eligible for GC [garbage collection]?
A. 0
B. 1
C. 2
D. Compilation fails
E. It is not possible to know
F. An exception is thrown at runtime
**** I understand that c1 is eligible, but it looks like c3 should also be null and eligible. *****