Harish Paravasthu

Greenhorn
+ Follow
since Dec 21, 2006
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 Harish Paravasthu

Hi Friend,

You can do it...Dont be afraid of real test as its simple than the mock tests available on Net.

So be cool and do your best in Test

All the best...

Cheers
Harish
SCJP Certified with 81%
Hello frenz,

Thanks to all javaranch members and also Javaranch coordinators and especially Kathy Siera/Bert Bates bookm it really helped me alot in clearing my doubts/brushing up my java concepts.

Thanks all
Harish Paravasthu
14 years ago
Hi,

Here is the output..

Test Pre r1 r4 In Main2 b1 b2 r3 r2 Hawk

Harish
[ May 15, 2007: Message edited by: Harish Paravasthu ]
Hi,

Please give a sample code of your problem...

Thanks
Harish
hai sonali,

Yes, you can get that book at ApaBalwanthChowk in PUNE.

Harish
Hai Ritu,

you told that all references will be having a copy of a reference,so by that time b,c and d are garbage collected,so though you dereference d to null,its already vanished away in the picture.so only three objects are garbage collected,

hope you got cleared...

Harish
public class Test{
public static void main(String[] args)
{
Object a = new Object();
// the object original referenced by object reference a
Object b = new Object();
Object c = new Object();
Object d = new Object();
d=c;
c=b;
b=a;
d=null;
}
}

A small change to the above code...here in this case,how many objects go into garbage collected???

i think only one object...
can any one say what actually it means by d=c=b=a here in code???
i think all are having the same reference to one object...but if so what is that reference???
Hai,

Actually Abstract classes are not allowed to instantiate.

Here in this ex: we have just created a reference of type abstract class and using that reference we have invoked the abstract method call(or any non-abstract method in abstract class).

so while compiling compiler checks only if that absract class is instantiated if so,will throw an error at compile time,if used the reference of it to acces methods in it,compiler gets satisfied as we didnt create object of it,
but the runtime will throw an error as there is no object created for it and we are accessing method by null...so JVM throws nullpointer exception.

Harish...
Hai Jyothi,

Thanks for your deatiled answer... so you say compiler wont check whether the overriding method throws exception or not,but when we call the overridden method,programmer should handle it as it throws checked exception other wise it would be an unreported exception and compiler spit an error...am rite?

Harish
Haii,

if its formatted in braces,then go according to it..else go for right to left as said above.

answer is false...

harish
Hello Frenz..

Am also confused that java is pass by reference but its not...it is by PASS BY VALUE

Explanation:

when we pass parameters to a method...we are actually passing the "COPY OF REFERENCE VALUE i.e in bits"
so whatever the variable we are just passing the size(in bits) of that type.

Harish..
i think the answer would be A0B0J1C1B1J2C2B2.

Explanation:

when i enter first int ofor loop,initialize i,so calls method prints A0.Next checks for the condition so again calls method prints B0.Now enters into the loop,calls method,prints J1.So loop continues until i is equal to 2.

Harish.
Hello all,

According to my understanding, static variables store in stack and not in Heap as only instance variables/objects live in Heap.(static variables doesnt belong to instance its class variable).
If anyone has detailed answer to it.Please post.

Harish
hai,

can you please keep the code in a proper format...Am not able to get the second line...

Thanks