
how to access input as integer in java?

import java.util.*;
class InputNumber
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("Enter Number: ");
int num=input.nextInt();
System.out.println("Entered Number is: "+num);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.