Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Jason Perry   on Apr 17 In Java Category.

  
Question Answered By: Varun Mehta   on Apr 17

These are compile time concerns, and I could see a few variations here and there. However, if you put a language designer hat on, SubVarargs is indeed a SuperVarargs and its print method  should be able to respond to a sequence of integers. You might by now ask then why an absence of such a signature  will prevent the good old style from responding to such a sequence. Well, the sequence thing implies/enforces a few things. For example, any such a parameter should be the last one and so. Therefore, even though it is clearly the same in your example, these two things are not universally the same/equvalent. I guess you see where I am going with this.

In any events, my point is based on absolutely nothing. Of course I have a hunch too and my hunch beats yours :)

Share: 

 
 
Didn't find what you were looking for? Find more on Overloading Vararg methods Or get search suggestion and latest updates.


Tagged: