Interview Solution

First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack. George Carrette

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.