hello, guyzz,,i hope you can help me,,actually,,this is not my whole code.but please help me with this...
public class Calculator {
public static void main (String args[]) {
String exp = JOptionPane.showInputDialog("Enter mathematical expression: ");
exp = infixToPostfix(exp);
JOptionPane.showMessageDialog(null,"Postfix expression: " +"\n"+ exp);
public static String infixToPostfix (String infix) {
(some codes here).........
else {
JOptionPane.showMessageDialog(null, "Invalid expression.");
System.exit(0);
}
}
if i input an invalid expression, the program automatically read the infixToPostfix method...which prints "Invalid expression"..and i use System.exit(0); because i dont know how to call the 'main method" to ask again a "mathematical expression"....
do you know guys how to go back again in main method without exiting in the program if i input an invalid expression?????i really need your help,,,i would about to pass it tomorrow,,...thank you again guyz..