Computer Science
Write down the syntax with reference to Java Programming:
to accept an integral value
Input in Java
3 Likes
Answer
//Input through InputStreamReader Class
InputStreamReader read = new InputStreamReader(System.in);
BufferedReader in = new BufferedReader(read);
int a = Integer.parseInt(in.readLine());
//Input through Scanner Class
Scanner in = new Scanner(System.in);
int a = in.nextInt();
Answered By
3 Likes
Related Questions
What is the purpose of default in a switch statement? Explain with the help of an example.
What are the different ways to input the values in a Java Programming? Name them
Write down the syntax with reference to Java Programming:
to accept a fractional number
Write down the syntax with reference to Java Programming:
to accept a line of text