Skip to content

Commit 92c9e6b

Browse files
authored
Create Endianness.java
1 parent 38f77e7 commit 92c9e6b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Moderate-Level/Endianness.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//Write a program which prints the endianness of the system.
2+
3+
import java.nio.ByteOrder;
4+
5+
public class Main {
6+
public static void main(String[] args) {
7+
if(ByteOrder.nativeOrder()==ByteOrder.LITTLE_ENDIAN) {
8+
System.out.print("LittleEndian");
9+
}
10+
else {
11+
System.out.print("BigEndian");
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)