0

How to take value from the user in java during compile time

12th Feb 2017, 8:20 PM
Saksham Srivastava
Saksham Srivastava - avatar
3 odpowiedzi
+ 2
What do you mean by 'during compile time'? Do you mean during runtime? Then Scanner or BufferedReader.
12th Feb 2017, 11:40 PM
Tashi N
Tashi N - avatar
0
https://code.sololearn.com/c7nAr3R9TDcq/?ref=app Check out this. It's a program to take user input
13th Feb 2017, 2:47 PM
Kommoju Sunil Kumar
Kommoju Sunil Kumar - avatar
- 1
You cannot take user input at compile time. But the user can send arguments during compilation time to main method. Ex. javac try.java hi there class try { public static void main(String[] args) { for (int i = 0; i< args.length; i++) { System.out.print(args[i] + " "); } } } o/p:- hi there
13th Feb 2017, 4:56 AM
Varun Moghe
Varun Moghe - avatar