I'm writing an infix evaluator program and I'm having trouble with this statement:

```
c = Double.parseDouble((String) operands.pop());

```

"operands" is a stack which stores the operands. The .pop() method returns an object of type T (Since the stack is an ArrayList of type T). Since Double.parseDouble requires a string as parameter, I have caste it to a string. 

However, I am receiving this error:
java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.String

What mistake have I made?