• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Instance Method Overloading - Polymorphism

 
sr shashidhar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi frndz,

My Question is "When we are overloading instance methods" under which polymorphism it comes...? either it comes under Run-Time Polymorphism or Compile-Time polymorphism...?


Example :






either it comes under Run-Time Polymorphism or Compile-Time polymorphism...?



thanks in advacnce
 
Winston Gutkowski
Bartender
Pie
Posts: 10431
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sr shashidhar wrote:either it comes under Run-Time Polymorphism or Compile-Time polymorphism...?

1. Please EaseUp (←click). Using bold is akin to shouting; and nobody likes being shouted at.

2. IMO, there is no such thing as "compile-time" polymorphism - in fact, the term itself is an oxymoron - but, to answer your question, it is often used to describe method overloading (real polymorphism refers to method overriding).

Winston
 
Campbell Ritchie
Sheriff
Pie
Posts: 49472
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope it is not too late to welcome you to the Ranch
You ought to use the code button; I shall see if I can amend your post with the code button so you can see how much better the code looks
 
sr shashidhar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:I hope it is not too late to welcome you to the Ranch
You ought to use the code button; I shall see if I can amend your post with the code button so you can see how much better the code looks


Thanks Campbell...

frnds can anyone help me about my doubt with above code...
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:2. IMO, there is no such thing as "compile-time" polymorphism - in fact, the term itself is an oxymoron - but, to answer your question, it is often used to describe method overloading (real polymorphism refers to method overriding).

Hi sr shashidhar, did you not see this part of Winston's reply? Or do you have further questions?
 
sr shashidhar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes sir,

can anyone tel me what is the difference in the following statements. As i heard its dynamic dispatch, but what makes difference, where and when it is used...?

.


thanks in advance...

 
Winston Gutkowski
Bartender
Pie
Posts: 10431
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sr shashidhar wrote:yes sir,
can anyone tel me what is the difference in the following statements.

My apologies, sr. I deleted your duplicate posts, but I have a feeling that you updated the last of them while I was doing so. If so, please edit the remaining one again.

Winston
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic