PDA

Click to See Complete Forum and Search --> : Stack Or Heap


met0555
Jan 16th, 2011, 08:23 PM
Hi,

I would like to know if the following are stored in the heap or stack memory? (using the eclipse Java)

String s;
s ?

s = hello.changeString("Test")
s ?

Int n;
n?

public int goalInt(int nNew){
b = nNEW;
return nNEW + 2
}
nNEW ?


Thanks

honeybee
Jan 17th, 2011, 03:17 AM
ummm My guess would be the string goes on the heap while the ints go on the stack.

.

abhijit
Jan 18th, 2011, 03:37 PM
You should read this (http://blogs.msdn.com/b/ericlippert/archive/2010/10/11/debunking-another-myth-about-value-types.aspx?PageIndex=3)article: