Doktor J
4
Q:

import scanner

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 ... input
31
import java.util.Scanner;

Public class Scanner {
	Public static void main(String[] args) {
    	// Scanner *scanner name here* = new Scanner(System.in);
      	Scanner scan = new Scanner(System.in);
      	System.out.println("Type anything and the scanner will take that input and print it");
      	String next = scan.next();
      	System.out.println(next);
    } 
}
3
import 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

7
import java.util.Scanner;
4

New to Communities?

Join the community