04: Java primitives & objects memory consumption

Q1. How much memory space does a primitive type int occupy in Java? A1. 4 bytes. Q2. Java objects get stored in the heap memory space, but how about the primitive variables? A2. It depends. 1) Primitives defined locally would…

Java Interview FAQs

800+ Java Interview Q&As