Welcome Message

Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.

January 3, 2010

Prog to find if a machine is Little Endian or Big Endian

import java.nio.ByteOrder;

public class FindEndianness {

public static void main(String[] args) {
ByteOrder b = ByteOrder.nativeOrder();
if(b.equals(ByteOrder.BIG_ENDIAN)){
System.out.println("Big Endian");
}else if(b.equals(ByteOrder.LITTLE_ENDIAN)){
System.out.println("Little Endian");
}
}

}

2 comments:

arvind said...

This was really good.
I liked this blog.
Keep this work going on..i have my interview at adobe day after 2morow.

Unknown said...

You can mail me for any queries you might have.

Thanks