What is the parseInt() method?
What is the parseInt() method?
Rating:
The parseInt() method is a static method of the Integer class. Two versions of the parseInt() method are defined in the Integer class. Their signatures are given below:
The first form of the parseInt() method returns an integer representation of the number contained in the string argument as a signed decimal integer.
The second form of the parseInt() method returns an integer representation of the number contained in the string arguments by using the specified base.
Both of the methods throw an object of type NumberFormatException in case the string passed as an argument to the method does not contain a parsable int type number.
Rating:
Other articles
- What is the switch statement?
- What is a member class?
- What is the synchronized keyword?
- What is the PriorityQueue class?
- What is a native method?