Convert short value to string
String toString()
- Returns a String object representing this Short's value.
static String toString(short s)
- Returns a new String object representing the specified short.
public class Main {
public static void main(String[] args) {
Short shortValue = new Short("10");
System.out.println(shortValue.toString());
System.out.println(Short.toString((short)10));
}
}
The output:
10
10
Home
Java Book
Essential Classes
Java Book
Essential Classes
Short:
- Short class
- Find out the min value, max value and size of Short types
- Create Short object with its constructor
- Convert Short to byte, double, float, int, long and short
- Decode a string to short value
- Convert string to a short value
- Reverse the bytes in a short
- Convert short value to string
- Compare two short values