Convert Integer to String - Java Language Basics

Java examples for Language Basics:Variable

Description

Convert Integer to String

Demo Code

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

Result


Related Tutorials