taking string input in java
Scanner in = new Scanner(System.in);
String s = in.nextLine();
taking string input in java
Scanner in = new Scanner(System.in);
String s = in.nextLine();
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);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us