gylph knor

Greenhorn
+ Follow
since Jun 12, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 gylph knor

no i mean to say that if my class takes 1 mb of memory in total then for suppose 10 objects will there be an allocation of 10*1mb=10mb of memory??
hi all,

could anyone please explain that if i make 1000s of instances of the same class then how will the memory be allocated to the instances of the class( i mean to diffent parts of the class i.e methods and attributes ) ...... please help !!!
dear ranchers
i passed SCJP 1.6 with 80% , few days back. Although i read a lot of books , but probably the best book for the exam preparation is SCJP 1.6 by Kathy Sierra and Bert Bates. Thanks for the great book!!!
15 years ago
and i added the Thread.sleep(10000) to allow me to see that my finalize method has executed, otherwise its very difficult to see.
hi,

yes i understand what should happen here. i am trying to fill the memory with objects having no refrence, thus forcing the garbage collector to run and in turn execute the finalize method. But this doesn't happen. i do not understand why? can someone help?
hi! can anybody tell that why this program not printing "dead" but is rather throwing this exception after creating a few objects







Program:



this is a piece of code that complies and runs fine:



how is this happening?
we know that string objects are created once and have the same value through their lifetime!!
15 years ago
yes , but why will it call the finalize method while collecting the abandoned objects?
can anyone explain in greater detail what he's trying to say?
Source:www.jchq.net


[ June 30, 2008: Message edited by: gylph knor ]
OK , now i get it.

thanks a lot!!
polymorphism is applied on mthods only ,
variables are not polynorphic
15 years ago
i still didn't get it ,

when an instance is type casted, how does it still remains the old object?
[ June 24, 2008: Message edited by: gylph knor ]
Please have a look at my code and tell me why this complie time error is being thrown


can't i use any method other than the toString() method in my deserialised object?





Error:
___________________________________________________________

H:\java>javac wwe.java
wwe.java:34: cannot find symbol
symbol : method good()
location: class java.lang.Object
System.out.println(fgh.good());
^
1 error

H:\java>






please help!!!

[ June 24, 2008: Message edited by: gylph knor ]
[ June 24, 2008: Message edited by: gylph knor ]
Thanks Noam. Will Eclipse be good ,or should i get any other( actuallly i have no idea about IDEs)?