Online Java Compiler By
JavaTpoint.com
import java.util.Scanner; public class IntegerValueOfExample5 { public static void main(String[] args)throws NumberFormatException { //Enter input from user console System.out.print("Enter Desired Value: "); Scanner scan = new Scanner(System.in); String strVal = scan.nextLine(); scan.close(); //Print the output value in decimal format System.out.println("Integer Value:" + Integer.valueOf(strVal)); } }
Output