Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print the console value in my Eclipse?

Tags:

java

console

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?

like image 767
unknown Avatar asked May 31 '11 11:05

unknown


People also ask

How do I print text from console?

To print a String to console output, you can use System. out. print() or System.

How do I download the console output in Eclipse?

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.

How do I view the console log in Eclipse?

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.


1 Answers

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);
like image 112
Sebastian Łaskawiec Avatar answered Sep 28 '22 04:09

Sebastian Łaskawiec