Page 1 of 1

JAVA: Assume a machine with a 4-byte word and word alignment. Char uses 1 byte, long int uses 4, and short int uses 2. a

Posted: Mon Jul 11, 2022 9:55 am
by answerhappygod
JAVA:
Assume a machine with a 4-byte word and word alignment. Charuses 1 byte, long int uses 4, and short int uses 2.
a) Determine the size in bytes of the following dataclasses.
b) Rearrange them so they use less space and indicate their newsize in bytes.
class myData { short int streetNum;
long int apartMentNum;
short int blup;
char oink[8];
};