I came to know that byte and short are interpreted as int type in java. If that is correct, please let me know why do we need byte and short primitive data types in java. Is it just for type checking by the compiler?
And also byte will take 1 byte of memory and short will take 2 bytes of memory, and int type takes 4 bytes. Please let me know if it is not a performance issue to save byte and short types in 4 bytes as byte and short are interpreted as int type.