Vertex
Vertex

Reputation: 2712

Does the result of Integer.toHexString depend on the system endian?

Is the static method toHexString() of Integer and Long dependent on the system endian, that is does it vary between little endian and big endian platforms?

Does

final String hex = Integer.toHexString(123456);
System.out.println(hex);

always print 1e240 on every supported Java platform?

Upvotes: 1

Views: 262

Answers (1)

Johnbot
Johnbot

Reputation: 2179

Yes, the representation will always be the same. See Integer.toHexString(int) and Java's Virtual Machine's Endianness

Upvotes: 1

Related Questions