This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Execution Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Execution" Watch "Execution" New topic
Author

Execution

sandhi mridul
Ranch Hand

Joined: Jan 25, 2008
Posts: 71
Hi,



Output is :30,30,10,20

What is going on in the program?
How the control is getting transfer in the program?
Please help me.

Thanks
ahmed yehia
Ranch Hand

Joined: Apr 22, 2006
Posts: 424
Objects 'o1' and 'o2' both refer to an object of type 'C', so m1() in class 'C' is invoked twice, because overridden instance methods invocation is determined at Runtime based on the object type.

Variable access is determined at Compile time based on the reference type.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Execution
 
Similar Threads
ClassCastException
Object Reference
mock exam query
Question about polymorphism and casting
lots of "extends" ??