What does this code represent?

import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scan = new Scanner (System.in); System.out.println("inter number"); int user_input_number = scan.nextInt(); System.out.println("entered number is"); System.out.print(user_input_number ); } }

5th Apr 2017, 6:36 PM
Faridi Adidi Sadick
Faridi Adidi Sadick - avatar
2 Answers
+ 5
It scans a number and prints it.
6th Apr 2017, 1:01 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 2
The code ask user to enter a number then print the same. 1. importing scanner class to have accessibility for input object. 2. class code begins. 3.main function begins. 4. declared object of scanner class to take input. 5. message user to enter a number. 6. takes input in an int type var user_input_number. using nextInt function. 7.print the same user input on screen.
5th Apr 2017, 7:01 PM
GeekyShacklebolt - avatar