Hi James, Thank you so much,but do you have any suggestion to my code?

This is the code on top of my forloop which i posted above.do you have any corrections?

public static void main(String...args)
        InfixToPostfix s =new InfixToPostfix(20);
        Object[] Infix;
        Object[] postfix;

        int count=0;
        char ch='\u0000';

         System.out.print("Enter infix: ");
         String str =new java.util.Scanner(System.in).next();

         Infix=new Object[str.length()];
         postfix=new Object[str.length()];

Just what has already been said... since you only store Characters in your arrays it would be better to make them Character[] rather than Object[]. That way you won't need all those casts.


@JamesCherrill @Taywin,Thank you so much...yup that's what taywin said to me.
Hmm...do you have any additional in this program?


I don't have any thing to add for you for this program. You could try another problem for more practice. ;)


@james @Taywin @NormR1,Thank you so much it really helps me a lot,i hope i will not forget all the knowledge that you shared to me.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.