In C and C++, you can use int num[100];
, so space allocation happends on stack memory. In Java, you can NOT use int[100] num;
, but only like int[] number = new Integer[100]
which make allocation on heap-memory.
So, is it true that Java does NOT support fixed size array on stack? If so, why?