- 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
Java Program to convert a string into a numeric primitive type using Integer.valueOf()
The Integer.valueOf() method is used in Java to convert a string into a numeric primitive type.
Let’s say the following is our string.
String str = "989";
To convert it into Integer primitive type, use Integer.valueOf()
Integer.valueOf(str)
Let us see the complete example to convert a string to Integer primitive type.
Example
public class Demo { public static void main(String[] args) { String str = "989"; System.out.println(Integer.valueOf(str)); } }
Output
989
- Related Articles
- Java Program to convert a Primitive Type Value to a String
- Java Program to convert Java Float to Numeric Primitive Data Types
- Java Program to convert Double to numeric primitive data types
- Java Program to convert String to short primitive
- Convert Long to numeric primitive data types in Java
- Convert Byte to numeric primitive data types in Java
- Convert Short to numeric primitive data types in Java
- Convert double primitive type to a Double object in Java
- How to convert primitive data into wrapper class using Java?
- Java Program to convert a String to a float type Number
- Java Program to Convert a String into the InputStream
- C++ Program to Convert String Type Variables into Boolean
- C++ Program to Convert int Type Variables into String
- Golang Program to convert string type variables into Boolean
- Golang Program to convert string type variables into int

Advertisements