How to convert into to String in Java?

Ads
 

How to convert into to String in Java?

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

Ads









Related Tutorials/Questions & Answers:
How to convert into to String in Java?
How to convert a String to an int?
Advertisements
How to Convert String to Date?
How to convert String into java.util.Date
How to convert string to byte in Java
how to convert string to image in java
how to convert string to double in java
how to convert string to double in java
how to convert string to double in java
how to convert string to double in java
How to convert String to int in Java
How to convert String to int in Java
How to convert String to int in Java
How to convert String to int in Java
How ro convert char into string??
How to convert date to string in Java?
How to convert Arraylist into String Array Java
How to convert Input Stream to String in java
Please tell me how can i convert string to timer
How to convert a stack trace to a string?
How to convert a stack trace to a string?
How ro convert char into string using recursive function in c#??
Java2
Convert String to Number
How to convert date to string in Java in yyyy-mm-dd format
How to convert string to date in java in yyyy-mm-dd format?
convert string to date nsdate
Convert String to long
Read/Convert an inputStream to a String
How to convert String Date to Timestamp in Java?
How to Convert ArrayList to Array?

Ads