answersLogoWhite

0

Why we use IntegerParseInt in java?

Updated: 8/11/2023
User Avatar

Wiki User

12y ago

Best Answer

Parsing is very important since the input from the user is not in the form of ints but in a String, therefore, you have to parse the String containing the number into a primitive data type.

i.e.

String num = "49";

int realNum = Integer.parseInt(num); // puts 49 into realNum;

User Avatar

Wiki User

16y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

We use "Integer.parseInt" to convert a string into a integer value. If the the string is not an integer, it will throw a NumberFormatException.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

it is used for taking the input from the user..........java reads it as the string...so integerparseInt is used to taking the input and convert it to the string....

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why we use IntegerParseInt in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is java 7?

Java 7 is the most current version of Java. Many movies and games use Java.


Do you have to use java?

Not usually. There are numerous languages out there with similar functionality. The only time you must use Java is if your employer or client demands that a project be done in Java, or a particular platform requires the use of Java, such as Android OS.


What are the Names of header files in java?

Java doesn't use header files.


Can you do java keylogger?

Yes, it is possible to write a keylogger in Java, but you would need to use the Java Native Interface to do so.


What is a connection class in java?

to connect java and data base...use connection stament

Related questions

Why args0 is used in IntegerparseInt in Java?

It is the default argument name for all Java BIF (Built-In Function)s.


Can you use pointers in java?

Java does not support Pointers and hence you cannot use it in Java.


What technologies link to Java?

Java is exclusive to surfing the web. Some web sites use Java to embed videos, others use Java for advertisements.


Does Java Script use the same compiler as Java?

No


What you use in case of pointer in java?

Java does not have pointers


What is java 7?

Java 7 is the most current version of Java. Many movies and games use Java.


Which is the best Book to understand JAVA in short?

You can use Head First Java or Java Complete Reference to learn Java.


Do you have to use java?

Not usually. There are numerous languages out there with similar functionality. The only time you must use Java is if your employer or client demands that a project be done in Java, or a particular platform requires the use of Java, such as Android OS.


How do you script a RuneScape bot?

RuneScape bots use Java. Use a Java Binary Code.


Why you not use clrscr in java?

Many reasons, one of them: there is no 'clrscr' in Java.


What software package would you use to write Java?

You would use the Java Development Kit (JDK).


Do you use pointers in java?

no