Horje
how to use scanner class in java Code Example
java 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
how to use scanners in java
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);
    } 
}
how to use scanner class in java
// import Scanner
import java.util.Scanner;

// Initialize Scanner
Scanner input = new Scanner(System.in);

// Test program with Scanner
System.out.println("What is your name?");
String name = input.nextLine();

System.out.println("Hello," + name + " , it is nice to meet you!");




Java

Related
java loops Code Example java loops Code Example
ontouch android Code Example ontouch android Code Example
convert bytebuffer to string Code Example convert bytebuffer to string Code Example
how to make an int into a string java Code Example how to make an int into a string java Code Example
java terminal colors Code Example java terminal colors Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8