Why do we need to create an object in heap?
问题 why can we use the stack for all our needs? NOTE: it will be very good if you give an example while explaining because it is easier to understand with examples. sorry for bad English. 回答1: In practice the call stack is limited and small. The typical limit is a few megabytes. In contrast, you could often allocate gigabytes in heap memory. (on some systems, you might configure the system to have a larger stack; but you need to tell your users if you need that) Also, and most importantly, the