Home Answers Viewqa Java-Beginners How to convert into to String in Java?

 
 


Java Coder
How to convert into to String in Java?
1 Answer(s)      4 months and 28 days ago
Posted in : Java Beginners

Hi, How to convert into to String in Java?

Thanks

View Answers

December 21, 2012 at 4:40 PM


Hi,

For this following code can be used:

Integer.toString(i);

Here is the complete example:

class IntegerToString 
{
    public static void main(String[] args) 
    {
        System.out.println("Converting Integer to String");
        Integer i= new Integer(10);
        String s = Integer.toString(i);
        System.out.println(s);


    }
}

See the tutorial Convert an Integer into a String.

Thanks









Related Pages:

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.