我在尝试将存储在栈中的字符转换为整数,我做的是这样的。
operands = new StackLinked();
if ( (a == 0 ) || (a == 1 ) || (a == 2 ) || (a == 3 ) || (a == 4 ) ||
(a == 5 ) || (a == 6 ) || (a == 7 ) || (a == 8 ) || (a == 9 ) )
{
operands.push(a); /*Stor operands in the stack operands.*/
}
//This line crushes my program. I don t know why.
int op1 = ((Integer)operands.peek()).intValue();