Convert short to String
In this chapter you will learn:
Convert short value to string
To convert short value to string we can use the following methods.
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());
/*j a v a 2s . c o m*/
System.out.println(Short.toString((short)10));
}
}
The output:
Next chapter...
What you will learn in the next chapter:
Home » Java Tutorial » Primitive Data Types