i found problems here it says,,
non-static method blah blah blah cannot be referenced from a static context
which is the function convertToPostfix and convertToInfix is not a static method....
how to fix this, so that i can now compile my code.
public static void main (String[] args)
{
String n, result;
char character;
do {
character = choiceko();
switch (character)
{
case 'P':
case 'p': n=numberko("Enter a number: ");
=======> result = convertToPostfix(n); <============
JOptionPane.showMessageDialog(null,
"Infix: " + n + " to Postfix [" +result+"].");
break;
case 'I':
case 'i': n=numberko("Enter a Number: ");
=======> result=convertToInfix(n);<============
JOptionPane.showMessageDialog(null,
"Postfix: " + n + " to Infix [" +result+"].");
break;
case 'E':
case 'e': JOptionPane.showMessageDialog(null,
"Program Terminated...","Terminated",JOptionPane.WARNING_MESSAGE);
break;
default: JOptionPane.showMessageDialog(null,
" Invalid selection. Please Try Again.","ERROR",JOptionPane.WARNING_MESSAGE);
}
}