Is there any built-in method in Java to find the size of any datatype? Is there any way to find size?
You can use Integer.SIZE / 8, Double.SIZE / 8, etc. for primitive types from Java 1.5.