File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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: 1545

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)
wood burning stoves
subject: Casting
It's not a secret anymore!