Memory allocation for primitive and reference variables
<p><code>type name;</code></p>

<p><strong>For reference types,this notifies the compiler that you will use name to refer to data whose type is type. With a primitive variable,this declaration also reserves the proper amount of memory for the variable.</strong> </p>

<p>Above are the exact lines i read from oracle docs java tutorials.</p>

<p>My question is, when does memory allocation take place. During compile time or run-time??
Is that same for both primitive and reference variables?</p>
