Saturday 4 July 2015

How To Convert Integer To String In Java


public class IntToString {

    public static void main(String[] args) {
         int num = 10;
      
       // method first
     
       String str1 = Integer.toString(num);
     
        System.out.println(" String is ="+str1);
       
        // method second
   
       String str2 = String.valueOf(num);
   
        System.out.println(" Striing is ="+str2);
  
   }

}

No comments:

Post a Comment