Peter Hsu wrote:Hi
Can someone give me a few rules of when casting/autoboxing can happen and when couldn't it?
I am confused.........
In
java , in case of primitives any smaller data type can be assigned to greater one .This is called widening.
But for narrowing you have to make a cast if the assigned value is greater than its size limit.
For rest of the things refer "Kaithy Sierra" for
SCJP.