Print an unsigned short in Java

Use Short.toUnsignedInt and print the resulting int:

System.out.println("Value of my unsigned short: " + Short.toUnsignedInt(s));

Comments

Be the first to comment!