This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes casting problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Java in General
Bookmark "casting problem" Watch "casting problem" New topic

casting problem

Savvy Makol

Joined: Jun 03, 2003
Posts: 6
Kindly somebody explain the difference between upcasting and downcasting.When do we get classcast exception.
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
please refer to Inheritance and Exceptions, Object-oriented Programming in Java, and Items in java.jdk.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Don, it might be more useful if you distilled these articles into an answer. I'm a big fan of reading articles, but sometimes people just want their question answered.
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
i will.
Have you checked out Aspose?
subject: casting problem
It's not a secret anymore!