Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

nidiya gaspar

Greenhorn
+ Follow
since Jan 31, 2001
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 nidiya gaspar

hi ,
I guess "1" is the correct answer
regards
nidiya
Hi navin,
Pls forward it to me also..
lima_rr@yahoo.com
thanks
nidiya

[This message has been edited by nidiya gaspar (edited February 03, 2001).]
hi Val dra,Michael and Peter,
Thank u for ur immediate response. Val Dra, i guess it is safe, to order it online.
Peter, taking ur advise, i have decided to buy it. Thank u very much.
regards
nidiya
hi friends,
I like to know, whether it is worth buying JQplus Mock Exams. Have anyone tried it ? I would be very glad to know ur advise on this.
Thank u.

regards
nidiya
hi,
I tried using final variables as member variables without initializing. It gives compile time error even if it is not used anywhere in the program.
But local variables can be left unassigned, if it is not used anywhere in the program. It gives no error.
So ur assumption is correct.
All the best
hi siva,
I read the reply of Sri.(It is as following)
Siva,
The question that started this discussion was mentioning 'Access Modifier' and you brought 'static' into the picture. 'Static' is only a modifier not a 'Access Modifier'. Access Modifiers are 'public, protected and private' (I wonder why 'package' (default) isn't mentioned in RHE book).
~Sri~

Sri, static is also a Access Modifier. I have confirmed it in Java language specification.
The default (if nothing specified) is also a Access Modifier and it is mentioned in RHE book.
I think the answer must be 1 and not 3.
regards
nidiya

hi,
In case, u need more explanation, then u can read the following. I have tried to explain it in a simple way.
Object a = new Object();
Object b = new Object();
Object c = new Object();
Object d = new Object();
Imagine that the Object reference variable "a" refers to an Object Ob1.
Similarly, "b" refers to an Object Ob2. "c" refers to an Object
Ob3. "d" refers to an Object Ob4.
After the statement, d=c=b=a
"a" still refers to Ob1.
"b" also refers to Ob1.
"c" also refers to Ob1.
"d" also refers to Ob1.
So the objects Ob2, Ob3 and Ob4 are left unreachable(not used). That makes the 3 (Ob2,Ob3,Ob4) Objects eligible for garbage collection.
Hope this will do.
All the best
regards
nidiya