- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to convert String to Integer and Integer to String in Java?
Java lang package provides Integer class which has methods to convert integer to String and vice versa. You can convert a String to an integer using the parseInt() method and Integer to String using the toString() method.
Example
public class Sample { public static void main(String args[]) { String str = "1212"; int num = Integer.parseInt(str); System.out.println(num); String st = Integer.toString(num); System.out.println(); } }
Output
1212 1212
- Related Articles
- Convert Integer to Hex String in Java
- Java Program to convert from integer to String
- Java Program to convert from String to integer
- Java Program to convert integer to String with Map
- Java Program to convert String to Integer using Integer.parseInt()
- C# Program to Convert Integer to String
- Convert string to integer/ float in Arduino
- How to convert a string to a integer in C
- How to convert a string into integer in JavaScript?
- C# program to convert binary string to Integer
- Python – Convert Integer Matrix to String Matrix
- Program to convert List of Integer to List of String in Java
- Program to convert List of String to List of Integer in Java
- Program to convert Set of Integer to Set of String in Java
- Program to convert set of String to set of Integer in Java

Advertisements