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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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];
};
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply