interface I{
}
class A implements I{
}
class B extends A {
}
class C extends B{
public static void main(String args[])
{
A a = new A();
B b = new B();
b = (B)(I)a; //Line 1
}
}
I know this is not an actual code :)
I just need to know how the casting gets done at Line 1.
I know the reference variable 'a' gets cast to Class B/Interface I.
But I am not sure of the sequence in which the casting takes place..can someone tell me which cast gets executed first.
PS : I searched for similar posts but most of them were from C++.If a similar post is already there wrt to Java do point it..tx