how to cast this?

Hi Folks!

I am new in java and trying to cast a long in integer. I am not sure what抯 wrong in my code?

Can anybody tell me what抯 wrong and how should I get it correct?

Here is my code.

Integer a1,b1;

Stack st =new Stack();

a1 = (Integer)st.pop();

b1 = (Integer)st.pop();

long x;

x=(long)a1;

sdos.writeLong(x);

dos.flush();

Thanks a lot in Advance.

[529 byte] By [asyed01a] at [2007-11-27 7:04:31]
# 1
x = a1.longValue(); http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html#longValue()
kevjavaa at 2007-7-12 18:55:48 > top of Java-index,Java Essentials,New To Java...