akash azal wrote:can you please tell me the basics of casting this example is not clear .how casting is performed here.can you please explain
What "basics" do you want to know, your question is somewhat vague. You've asked how to cast with inheritance I've shown you, do you want something more specific?