+ 1

How to input a sentence in java(String) ..??

25th Jun 2017, 5:42 AM
Md Riad Hasan Sarker
Md Riad Hasan Sarker - avatar
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()); } }
25th Jun 2017, 5:49 AM
NSA94
NSA94 - avatar
0
tnx # nuwan
25th Jun 2017, 6:11 AM
Md Riad Hasan Sarker
Md Riad Hasan Sarker - avatar