Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Home Java Java-conversion Convert an Integer into a String

Related Tutorials


Share on Google+Share on Google+

Convert an Integer into a String

In this section, you will learn to convert an integer type data into a string type.

Convert an Integer into a String


In this section, you will learn to convert an integer type data into a string type. The java.lang package provides this conversion  functionality through toString() method.

Code Description:

This program takes an integer number at  the console and it converts it into a string format using the Integer(str).toString() method. The given number takes an integer number that must be converted into an string format. The toString() method convert Integer number to string number.

The toString() method converts an integer value into a String. 

Here is the code of this program:

import java.lang.*;

public class  IntegerToString {
  public static void main(String[] argsthrows IOException{
  BufferedReader read = 
new BufferedReader(new InputStreamReader(;
  System.out.println("Enter the integer value!");
  String str = read.readLine();
  String s = new Integer(str).toString();
  System.out.println("String:=" +s);

Download this program:

Output this program.

C:\corejava>java IntegerToString
Enter the integer value!
string: 24



If you enjoyed this post then why not add us on Google+? Add us to your Circles

Liked it!  Share this Tutorial

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: June 15, 2007

Related Tutorials

Discuss: Convert an Integer into a String   View All Comments

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
March 27, 2011
java question

what will happen if we write static before public in java
pradeep joshi
February 17, 2013
wrong description check it out
January 20, 2012
Integer to string conversion

i need coding for Integer to string conversion....
January 31, 2012

thanks.......i got solution
February 18, 2012

<html> <body> hello </body> </html>
March 3, 2012

Thanks for your helpful tutorial!
April 11, 2012
Convert an Integer into a String

what an Idiot.... use this String x = String.valueOf(int);
July 20, 2012
java mail query

whenever I am trying to send mail using java program it is showing a "com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. ru10sm2458490pbc.50" error please help me
NaveenReddy Bommu
September 19, 2012
Another approach

int a=10; String s = a+""; system.out.println(s);
December 19, 2012

super concept