TheBulgarianWolf

Kotlin Input/Output

Mar 13th, 2021
721
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner
  2.  
  3. fun main(args: Array<String>){
  4.     //creates an istant which takes input from standart input(keyboard)
  5.     val reader = Scanner(System.`in`)
  6.     print("Enter a number: ")
  7.  
  8.     //nextInt() reads the next integer from the keyboard
  9.     var integer: Int = reader.nextInt()
  10.  
  11.     println("You entered $integer")
  12. }
RAW Paste Data