
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Convert String to Integer Using Integer.parseInt in Java
The Integer.parseInt() method in Java converts a string to an integer.
Let’s say the following is our string −
String str = "456";
Converting it into integer −
Integer.parseInt(str));
The following is the complete example −
Example
public class Demo { public static void main(String[] args) { String str = "456"; System.out.println(Integer.parseInt(str)); } }
Output
456
Advertisements