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);

}

}

Leave a Reply

Your email address will not be published. Required fields are marked *

56 − = 50