java scanner

Java
import java.util.Scanner;

// import scanner 

Scanner myScanner = new Scanner(System.in); // Make scanner obj

String inputString = myScanner.nextLine(); // Take whole line

boolean inputBoolean = myScanner.nextBoolean(); //Boolean input

long inputLong = myScanner.nextLong(); //Interger,long ... inputimport java.util.Scanner;//import Scanner

Scanner input=new Scanner(System.in);//Create the scanner Obj

float numF = input.nextFloat();//Returns float
int num1 = input.nextInt(); //Returns int
byte byte1 = input.nextByte();//Returns Byte
long lg1 = input.nextLong();//Returns long
boolean b1 = input.nextBoolean();//Returns bool
double num2 = input.nextDouble();//Returns Double
String nome = input.nextLine();//Returns String

//execution is pause until you give input

import java.util.scanner;

Scanner *scanner name* = new Scanner(*input source*);

// Examples:
Scanner user = new Scanner(system.in);
Scanner text = new Scanner(new File("text.txt"));
Source

Also in Java: