sridhar t patil wrote:To understand the java memory management...
OK, well there's a possible problem right there.
Unless you really need this information for something specific (like the
SCJP exam),
Java memory management is
(a) none of your business (it's the business of the
JVM).
(b) not under your control.
Back when I was learning C, it was useful to know about stack frames and memory partitions and the like, because it could make a big difference to how a program ran; but in Java - unless you plan on writing a new, improved garbage collector - it really isn't necessary. In fact, it's more likely to be a distraction than anything else.
I can honestly say that in 12 years of using Java, I have never once worried about whether a program (or value) uses stack or heap memory. I create values, I use them, and I trust the JVM to get rid of them if and when it can - it really is as simple as that.
HIH
Winston