My objective is to implement a GUI calculator in java. I am thinking of passing the expression entered by the user to bc and then get output from terminal and print to user. My question is
- How to execute a terminal command from java so that i can pass the expression to bc
- How to get output from terminal. Right now I am thinking of redirecting terminal to file and then reading from file but please tell me if it is possible to do directly.