Memory requirement of a program in java
Consider the class below, and notice the comment telling how much bytes they use.
There is a overhead of 16bytes for maintaining class, 1 Byte for byte and boolean, 2Byte for char and short, 4 bytes for integer, 8 bytes for long and double, and some overhead for padding, to make overall memory even, to sum up:
Java type
Bytes required
boolean
1
byte
char
2
short
int
4
float
[Read More]