Interview Solution

There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. C.A.R. Hoare

Big Or Little Endian

Language Java | Level Intermediate | Category Interview Problems | July 24, 2015 4:52 pm

Comments


Interview Problem

How to find the machine is big endian machine or little endian machine.
Write a program to find the machine is big endian or little endian. The terms endian and endianness refer to the convention used to interpret the bytes making up a data word when those bytes are stored in computer memory.
Each byte of data in memory has its own address. Big-endian systems store the most significant byte of a word in the smallest address and the least significant byte is stored in the largest address. Little-endian systems, in contrast, store the least significant byte in the smallest address.
Example:-
Return LITTLE_ENDIAN or BIG_ENDIAN based on machine type


Output

   					 
xxxx machine JVM is LITTLE_ENDIAN

				    

Comments



Please login to add comments.