java tutorial - Java parseInt() method - java programming - learn java - java basics - java for beginners
Learn Java - Java tutorial - Java numbers parseint - Java examples - Java programs
Description
The parseInt () method is used in Java to obtain a primitive data type of a particular string, in other words, it converts a string to a number. The parseXxx () method is a static method and can have one argument or two.
Syntax
The whole variant of the method is given below:
Options
Detailed information about the parameters:
- s is a string representation of a decimal value.
- radix - will be used to convert a string to an integer.
Return value
- parseInt (String s): returns an integer (only in decimal system).
- parseInt (int i): returns an integer, given the string representation of decimal, binary, octal and hexadecimal (radix is 10, 2, 8 or 16, respectively) of the numbers as inputs.