xxxxxxxxxx
// Java Program to Demonstrate Working of valueOf() Method
// Main class
public class GFG {
// Main driver method
public static void main(String args[])
{
// Custom wide-varied inputs to illustrate
// usage of valueOf() method
int decimalExample = Integer.valueOf("20");
int signedPositiveExample = Integer.valueOf("+20");
int signedNegativeExample = Integer.valueOf("-20");
int radixExample = Integer.valueOf("20", 16);
int stringExample = Integer.valueOf("geeks", 29);
// Print statements
System.out.println(decimalExample);
System.out.println(signedPositiveExample);
System.out.println(signedNegativeExample);
System.out.println(radixExample);
System.out.println(stringExample);
}
}