This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Casting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Casting" Watch "Casting" New topic


akila sekaran
Ranch Hand

Joined: Jun 12, 2012
Posts: 48

what will happen in this ?
Panagiotis Kalogeropoulos

Joined: May 27, 2011
Posts: 99

Have you tried it yourself? What do you think will happen and why?
akila sekaran
Ranch Hand

Joined: Jun 12, 2012
Posts: 48
Class cast exception ;-)
Anayonkar Shivalkar

Joined: Dec 08, 2010
Posts: 1541

akila sekaran wrote:Class cast exception ;-)

So, what are you casting into what? Please take a close look at your code (by the way, it also contains a compilation error, which I believe might be a typo during pasting the code).

Hint : All Managers are Employees - but can you cast an Employee to Manager?

Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Casting
It's not a secret anymore!