How to Convert a Short value to String value in Java with Examples Last Updated : 30 Jan, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report Given a Short value in Java, the task is to convert this short value to string type. Examples: Input: 1 Output: "1" Input: 3 Output: "3" Approach 1: (Using + operator) One method is to create a string variable and then append the short value to the string variable. This will directly convert the short value to string and add it in the string variable. Below is the implementation of the above approach: Example 1: Java // Java Program to convert short value to String value class GFG { // Function to convert short value to String value public static String convertShortToString(short shortValue) { // Convert short value to String value // using + operator method String stringValue = "" + shortValue; return (stringValue); } // Driver code public static void main(String[] args) { // The short value short shortValue = 1; // The expected string value String stringValue; // Convert short to string stringValue = convertShortToString(shortValue); // Print the expected string value System.out.println( shortValue + " after converting into string = " + stringValue); } } Output: 1 after converting into string = 1 Approach 2: (Using String.valueOf() method) The simplest way to do so is using valueOf() method of String class in java.lang package. This method takes the short value to be parsed and returns the value in String type from it. Syntax: String.valueOf(shortValue); Below is the implementation of the above approach: Example 1: Java // Java Program to convert short value to String value class GFG { // Function to convert short value to String value public static String convertShortToString(short shortValue) { // Convert short value to String value // using valueOf() method return String.valueOf(shortValue); } // Driver code public static void main(String[] args) { // The short value short shortValue = 1; // The expected string value String stringValue; // Convert short to string stringValue = convertShortToString(shortValue); // Print the expected string value System.out.println( shortValue + " after converting into string = " + stringValue); } } Output: 1 after converting into string = 1 Comment More infoAdvertise with us Next Article How to Convert a Double value to String value in Java with Examples C code_r Follow Improve Article Tags : Java Java Programs Java-Data Types Java-Short Java-String-Programs +1 More Practice Tags : Java Similar Reads How to Convert a String value to Short value in Java with Examples Given a String "str" in Java, the task is to convert this string to short type. Examples: Input: str = "1" Output: 1 Input: str = "3" Output: 3 Approach 1: (Naive Method) One method is to traverse the string and add the numbers one by one to the short type. This method is not an efficient approach. 2 min read How to Convert a String value to Byte value in Java with Examples Given a String "str" in Java, the task is to convert this string to byte type. Examples: Input: str = "1" Output: 1 Input: str = "3" Output: 3 Approach 1: (Naive Method) One method is to traverse the string and add the numbers one by one to the byte type. This method is not an efficient approach. Ap 2 min read How to Convert a Byte value to String value in Java with Examples Given a Byte value in Java, the task is to convert this byte value to string type. Examples: Input: 1 Output: "1" Input: 3 Output: "3" Approach 1: (Using + operator) One method is to create a string variable and then append the byte value to the string variable with the help of + operator. This will 2 min read How to Convert a Double value to String value in Java with Examples Given a Double value in Java, the task is to convert this double value to string type. Examples: Input: 1.0 Output: "1.0" Input: 3.14 Output: "3.14" Approach 1: (Using + operator) One method is to create a string variable and then append the double value to the string variable. This will directly co 2 min read Java Program to Convert a Float value to String Given a Float value in Java, the task is to write a Java program to convert this float value to string type. Examples: Input: 1.0 Output: "1.0" Input: 3.14 Output: "3.14" Strings - Strings in Java are objects that are supported internally by a char array. Since arrays are immutable, and strings are 4 min read How to Convert a String to an Long in Java ? In Java, String to Integer Conversion is not always effective as the size of the String can overpass Integer. In this article, we will learn the method provided by the Long class or by using the constructor of the Long class. Example of String to Long ConversionInput: " 9876543210"Output: 9876543210 2 min read Like