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?
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);