Reputation: 2712
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
Reputation: 2179
Yes, the representation will always be the same. See Integer.toHexString(int) and Java's Virtual Machine's Endianness
Upvotes: 1