MrDoyle

Scanner input

Sep 2nd, 2020
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner input = new Scanner(System.in);
  7.  
  8.         System.out.println("Please input your number: ");
  9.         int myVariable = input.nextInt();
  10.  
  11.         System.out.println("My variable is: " + myVariable);
  12.  
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment