Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class HelloWorld {
  4.  
  5.     public static void main(String[] args) {
  6.  
  7.         // Creates a reader instance which takes
  8.         // input from standard input - keyboard
  9.         Scanner reader = new Scanner(System.in);
  10.         System.out.print("Enter a number: ");
  11.  
  12.         // nextInt() reads the next integer from the keyboard
  13.         int number = reader.nextInt();
  14.  
  15.         // println() prints the following line to the output screen
  16.         System.out.println("You entered: " + number);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement