My Application is in some other folder, I call that function, the output is printed in my console.
How can I get the value from the console?
To print a String to console output, you can use System. out. print() or System.
For that, go to Run → Debug Configurations on Eclipse menu. Then under Standard Input and Output section, click on checkbox next to File: , and choose the name of output file to use. If you check Append underneath, console output will be appended to the output file.
From the left panel pick your project. Go to Common tab. Then under "Standard Input and Output" section, click on checkbox next to "Output File:", and choose the name of output file to use. If you check "Append" underneath, console output will be appended to the output file.
I'm not sure if I understand the question. However, you can use this code snippet to get line of text from console (it also works in Eclipse):
String val = new BufferedReader(new InputStreamReader(System.in)).readLine();
System.out.println("val = " + val);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With