casting problems

Say that I have a stack of character, and I want to extract the value of those stack into an integer. How can I do that?

below is my code:

publicint value(){

int result = 0;

char right =' ';

char left =' ';

int number = 0;

String temp = this.postfix();

Stack<E> s =new Stack<E>();

for (int i = 0; i<temp.length(); i++){

char c = temp.charAt(i);

if (c !='+' && c !='-' && c !='/' && c !='%' && c !='*' && c!='(' & c!=')')

s.push(c);

elseif (c =='+' && c =='-' && c =='/' && c =='%' && c =='*'){

right = s.pop();

left = s.pop();

number = left + s.pop() + right;

s.push(number);

}

return result;

}

>

[1826 byte] By [aditya15417a] at [2007-11-26 20:02:11]
# 1
Check whether it works :Character.getNumericValue(char)
Pub_sqra at 2007-7-9 23:01:12 > top of Java-index,Java Essentials,Java Programming...