×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Kirill Leventcov
Added: Oct 26, 2021 6:13 PM
Views: 2191
Tags: int
  1. import java.util.Scanner;
  2.  
  3. public class Program {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner scanner = new Scanner(System.in);
  7.  
  8.         System.out.println("Write a value ");
  9.         int value = Integer.valueOf(scanner.nextLine()); // Reading an integer
  10.         System.out.println("You wrote " + value);
  11.     }