Convert Short object to String object - Java Language Basics

Java examples for Language Basics:short

Description

Convert Short object to String object

Demo Code

 
public class Main {
 
  public static void main(String[] args) {
    short s = 10;
    Short sObj = new Short(s);
   //from  w  w w . j a  v  a  2s  . co  m
    //use toString method of Short class to convert Short into String.
    String str = sObj.toString();
    System.out.println("Short converted to String as " + str);
  }
}

Result


Related Tutorials