How to convert an int into a String using valueOf() in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {

    public static void main(String[] args) {

        try {

            String s = String.valueOf(1000000);
            
            System.out.println(s);

        } catch (Exception e) {
            System.out.print(e.toString());
        }
    }
}

/*
           
run:
     
1000000
  
 */

 



answered Nov 22, 2016 by avibootz

Related questions

1 answer 195 views
2 answers 131 views
2 answers 297 views
1 answer 161 views
1 answer 152 views
1 answer 225 views
...