About Question enthuware.ocajp.i.v7.2.951 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
mihhay
Posts: 10
Joined: Wed May 09, 2018 12:48 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.951 :

Post by mihhay »

"For example, a Dog  "IS A" Animal, so you don't need to cast it. But an Animal may not always be a Dog. So you need to cast it to make it compile and during the runtime the actual object referenced by animal should be a Dog  otherwise it will throw a ClassCastException."

Reading this I was expecting to see ClassCastException...

I really really appreciate your wonderful explanation! Thank you!

Post Reply

Who is online

Users browsing this forum: mcpunjabi and 44 guests