This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Upcasting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Upcasting" Watch "Upcasting" New topic
Author

Upcasting

James Tharakan
Ranch Hand

Joined: Aug 29, 2008
Posts: 580



usung b is it possible to call the fun() of the Class A which is overridden in B


SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
usung b is it possible to call the fun() of the Class A which is overridden in B


Could you please share, why would you want to call A's fun instead of B's when its already overridden in B? Because this is the way it is expected to work.


Thanks and Regards
James Tharakan
Ranch Hand

Joined: Aug 29, 2008
Posts: 580

@ Satya Maheshwari

I agree with you.... But i was just trying out if it is possible??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Upcasting
 
Similar Threads
calling a method in a super class from a sub class
Garbage collection
Overriding
Overriding & Overloading
Overriden method question