infix to postfix... i need help
i cant get the output in post fix some one please help...heres my code
import java.util.Scanner;
import java.io.*;
import java.util.*;
public class Infix{
public static void main( String[] args){
Scanner scan=new Scanner(System.in);
Stack<String> stack = new Stack<String>();
System.out.println(" enter infix");
String s=scan.next();
while (!s.equals(0)){
String postfix="";
if ( s.equals("+")) stack.push(s);
else if ( s.equals("-")) stack.push(s);
else if ( s.equals("*")) stack.push(s);
else if ( s.equals("/")) stack.push(s);
else if ( s.equals("(")) System.out.print("");
else if ( s.equals(")")) System.out.print(stack.pop()+"");
System.out.println("postfix");
System.out.print(s);// I DONT KNOW HOW TO ADD ALL THE VARIABLES INTO A SEPERATE STRING
System.exit(1);
}
}
}