Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What kind of variables put onto calling stack, what on the heap in c++ and Java?

heap Java stack variables
0
Posted

What kind of variables put onto calling stack, what on the heap in c++ and Java?

0

In Java, object cannot put on calling stack. Only primitive types local variable and local references to Objects can be put onto stack. All objects are on the heap.This is different to C++. In C++, local objects can be put onto calling stacks. Object can be automatic variables.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.