This technique is utilized to get the prehistoric data type of a convinced String. parseXxx() is a static process and can have one argument or two. This method is utilized to get the primordial data type of a certain String. parseXxx() is a static process and can have one argument or two.
Following are all the variants of this method:
static int parseInt(String s) static int parseInt(String s, int radix)
Here is the detail of parameters −
public class Test { public static void main(String args[]) { int x =Integer.parseInt("9"); double c = Double.parseDouble("5"); int b = Integer.parseInt("444",16); System.out.println(x); System.out.println(c); System.out.println(b); } }
This will produce the following result −
9 5.0 1092
Here at Intellinuts, we have created a complete Java tutorial for Beginners to get started in Java.