+ 1
How to input a sentence in java(String) ..??
2 Réponses
+ 2
Use scanner library and create a scanner object. Read Java > Basic > Getting User Input for more information.
import java.util.Scanner;
class MyClass {
public static void main(String[ ] args) {
Scanner myVar = new Scanner(System.in);
System.out.println(myVar.nextLine());
}
}
0
tnx # nuwan