import java.io.*;
import java.util.*;
public class template {
public static void main(String[] args) throws IOException {
// Input:
// 12 243.92
// 100000000000000
// Hello!
Scanner r = new Scanner(System.in); // Creating a Scanner object
int a = r.nextInt(); // Reading in an int
double b = r.nextDouble(); // Reading in a double
long c = r.nextLong(); // Reading in a long
// .nextInt(), .nextDouble(), and .nextLong() do not advance the reader to the next line
// and .nextLine() reads the current line
// This line of code serves the purpose of advancing the reader to the next line
r.nextLine();
String d = r.nextLine(); // Reading in a line
}
}

Scanner Example