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 va  2s .c  o m
    //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