scanner.next java code example
Example 1: java scanner
import java.util.Scanner;
Scanner input=new Scanner(System.in);
float numF = input.nextFloat();
int num1 = input.nextInt();
byte byte1 = input.nextByte();
long lg1 = input.nextLong();
boolean b1 = input.nextBoolean();
double num2 = input.nextDouble();
String nome = input.nextLine();
Example 2: java scanner next()
String s = "Hello World! 3 + 3.0 = 6 ";
Scanner scanner = new Scanner(s);
System.out.println("" + scanner.next());
System.out.println("" + scanner.next());
scanner.close();