• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Overriding and Overloading.

 
Rohit Ramachandran
Ranch Hand
Posts: 102
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I was under the impression that the output would give "Super Super" since for Overriding it's the type of the reference variable that counts.

However, the output I'm getting is 0.0 and 9.0
 
Rohit Ramachandran
Ranch Hand
Posts: 102
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it the object type or reference type that determine which method is to be called in-
1)Overriding?
2)Overloading?

Thank you.
 
Prasad Kharkar
Ranch Hand
Posts: 446
1
Eclipse IDE MySQL Database Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reference type determines which overloaded method to be called at compile time
Object type determines which overriding method to be called at run time

 
Rohit Ramachandran
Ranch Hand
Posts: 102
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic