• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need argument against compile time polymorphism  RSS feed

 
Andrews Arokiam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all. In some interviews, the interviewer asks me about run time polymorphism and compile time polymorphism. I know about run time polymorphism. But I never knew compile time polymorphism. When I searched online it seems that people refer to overloading as compile time polymorphism. But many books authoritatively say that overloading has nothing to do with polymorphism and I can understand why. But I have to be really strong if I have to convince the interviewer. What should I do in sch case. Wont they think that I am showing attitude against them.
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrews, Welcome to JavaRanch!

Andrews Arokiam wrote: But many books authoritatively say that overloading has nothing to do with polymorphism and I can understand why.


Can you tell us which are those books? And why do you think overloading has nothing to do with polymorphism?
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrews Arokiam wrote:...I have to be really strong if I have to convince the interviewer. What should I do in sch case. Wont they think that I am showing attitude against them.

Welcome to the Ranch!

I don't think you need an argument. Personally, I would smile gently and say, "Well, there are differences of opinion on that terminology. Here are the two viewpoints..." You might also acknowledge that in a team environment, what's important is that everyone understands each other, so you'll be happy to use whatever terminology they prefer.
 
Andrews Arokiam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Head First Java for example. It clearly states that it has nothing to do with polymorphism. And am sure you cannot quote a recognized book to show otherwise.

In method overloading, we have different parameter list. So its just like having different names.

For example consider this,

There are 3 person by name Andy in a class having different initials. Now are they the same person that are behaving differently at different times. Obviously not.
This is what I could infer.
 
Andrews Arokiam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marc Weber,

Thank you. That sounds good. So I better be polite and point the difference in opinions.
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrews Arokiam wrote:Head First Java for example. It clearly states that it has nothing to do with polymorphism. And am sure you cannot quote a recognized book to show otherwise.

In method overloading, we have different parameter list. So its just like having different names.

For example consider this,

There are 3 person by name Andy in a class having different initials. Now are they the same person that are behaving differently at different times. Obviously not.
This is what I could infer.


Agree with this! I had thought overloading as form of polymorphism- reuse of the method name
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrews Arokiam wrote:...I better be polite and point the difference in opinions.

I really think that's the way to go. Demonstrate that you understand the different terms, but acknowledge that there are different perspectives on this. That will show the interviewer that you know what you're talking about and have some people skills. Besides, if they have a different perspective, you're not going to change their mind in a job interview. You're just going to make them defensive and leave them with a bad feeling about the meeting.

(I don't think the word "polymorphism" is even used in the Java Language Specification, which would be your best "authoritative" source. You could cite other sources backing up either perspective, so that's not going to help. Save the "argument" for friendly academic discussions after you've been hired.)
 
Andrews Arokiam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You again for your kind advice. So I am marking this thread as resolved.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrews Arokiam wrote:... So I am marking this thread as resolved.

But someone might still disagree...!
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(By the way, there is only "runtime" polymorphism in Java. Overloading is simply changing a method's signature. Just sayin'.)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!