Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What exactly was the task that you were given?</p> <p>The main difference between Java and C++ is that Java is garbage collected by the VM, whereas in C++ the program is directly executing on the machine and memory is managed through OS services.</p> <p>Regarding the stack, a frame is just a more "official" and standard form of what C++ compilers do. C++ compilers just put things on top of each other in the stack as you move from call to call. In Java the term is frame, and because compiled Java code is supposed to run on any platform, there are very clear standards on how that takes place. In C++, each compiler can treat the stack differently (e.g., even by the nature of the word size).</p> <p>In Java, everything runs within the VM which manages everything, though it delegates some stuff to the environment. In other words, you have no access to where the JVM puts your data and your code, and your code may never even become a real "code segment". In other words, this can't really be answered. In C++, everything works on the hardware, so you will have stack segments, data segments, etc. Look in information about C++.</p> <p>In C++, classes have no representation in memory at runtime; in fact, you can compile C++ into C and then compile the results into assembly. In Java, everything is also represented at runtime, so you can ask an object what class it belongs to and what method is supports. Hence, each class file has a "constant pool" where the strings representing those things like method names, field names, etc. appear. The actual class definition refers to the pool. So in other words, that has very little to do with stack frames. Stack frames are where method parameters, local variables, and return values are stored. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload