8 primitive types in java are int, char, byte, float, double, boolean, short and long.
Everything in java is not an object. Primitive datatypes are included in java for performance reasons.
For primitive types, we don’t use the new keyword. Using new will place the objects in heap, which would be very costly for small and simple variables. Primotive types create variables that are stored on the stack.
new() and malloc() allocate memory from heap.
Heap size is found at the compile time which varies from computer to computer.
Stack size is found at the run time which does not vary.
thanx,
Sandeep.