Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-10-2003, 02:28 PM   PM User | #1
Aymen++
Regular Coder

 
Join Date: Nov 2002
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Aymen++ is an unknown quantity at this point
Java

What is meaning of creating an object in the heap? and in the stack?
Aymen++ is offline   Reply With Quote
Old 08-11-2003, 06:13 PM   PM User | #2
Jason
Regular Coder

 
Join Date: Feb 2003
Location: California
Posts: 925
Thanks: 0
Thanked 0 Times in 0 Posts
Jason is an unknown quantity at this point
well, objects are a way of associating things I guess you could say. so if you wanted a heap or stack of peoples names they would only be names. But if you wanted some association so that the names might have some association you could have something like person.male.name or person.female.name where male and female are both types of persons and they each have a name associated with them. Does that make sense?

Jason
Jason is offline   Reply With Quote
Old 08-14-2003, 10:13 AM   PM User | #3
Aymen++
Regular Coder

 
Join Date: Nov 2002
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Aymen++ is an unknown quantity at this point
No, I didn't understand what you meant, my question is:
What is the diffrence between creating an object in the stack and creating it in the heap?
Aymen++ is offline   Reply With Quote
Old 08-14-2003, 06:54 PM   PM User | #4
Jason
Regular Coder

 
Join Date: Feb 2003
Location: California
Posts: 925
Thanks: 0
Thanked 0 Times in 0 Posts
Jason is an unknown quantity at this point
heap and stack are two different type of objects. The main differences are how stuff gets put on the heap as well as how they are take off. There are different types like FIFO which stands for first in and first off. In essence the first thing you put on will be the first thing that comes off in relation to all the other objects you add. There is also LIFO which is last in first off. So you start to see a pattern? As for heaps they are a different data type and store information differently. So depending on your program the way things get stored and how they get removed will depend on whether you want a heap or a stack.


Jason
Jason is offline   Reply With Quote
Old 08-15-2003, 10:29 PM   PM User | #5
Josh Campbell
New Coder

 
Join Date: Jun 2002
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Josh Campbell is an unknown quantity at this point
http://www.experts-exchange.com/Prog..._20245499.html

i think might help
Josh Campbell is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:44 AM.


Advertisement
Log in to turn off these ads.