parseInt() Method, parse Decimal to int Decimal in java

Java Programming Language / Number Class in java

1265

Program:

 
public class ParseDecimal {

   public static void main(String args[]) {

      int b = Integer.parseInt("125",10);

      System.out.println(b);
   }
}

/*
parseInt(int i) - This returns an integer, given a string
representation of decimal, binary, octal, or hexadecimal
(radix equals 10, 2, 8, or 16 respectively) numbers as input.

*/

Output:

125
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.