Wednesday, April 11, 2012

Java variable argument function!

I found an interesting compile time error today. Java allow variable argument function in that case the signature of the function looks something like, 

Class Y {
int func(int ... x)
}

However the function can be invoked as y.func() without any compile time error. That is kind of interesting for language like Java. It invokes the function with an array of integer of size 0. The same function can be overload with not argument at all! However they don't allow empty call if the function is overloaded with two different types of variable arguments.

17 comments:

  1. Excellent read I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that: Thanks for lunch!
    southlake roofing

    ReplyDelete
  2. These kind of post are always inspiring and I prefer to read quality content so I happy to find many good point here in the post.

    ReplyDelete
  3. Well i definitely liked reading it. This information provided by you is very constructive for correct planning. I like your work for providing information to the other.on, youve insured so many corners.thanks

    ReplyDelete
  4. I just want to emphasize the good work on this , has excellent views and a clear vision of what you are looking for…choice

    ReplyDelete
  5. Thanks for sharing! I agree with you. The artical improve me so much! I will come here frequently.feel comfortable

    ReplyDelete
  6. Really wonderful post. this blog is awesome.Posts with more information will be great.domain

    ReplyDelete
  7. when searching on this topic. I will check back in the future and see if you have more articles. Thanks for posting this, I appreciate the information and the effort you put into your site.

    ReplyDelete
  8. I will check back in the future and see if you have more articles. Thanks for posting this, I appreciate the information and the effort you put into your site.when searching on this topic.

    ReplyDelete
  9. Thanks for posting this, I appreciate the information and the effort you put into your site.when searching on this topic.I will check back in the future and see if you have more articles.

    ReplyDelete
  10. I appreciate the information and the effort you put into your site.when searching on this topic.I will check back in the future and see if you have more articles.Thanks for posting this

    ReplyDelete
  11. the information and the effort you put into your site.when searching on this topic.I will check back in the future and see if you have more articles.Thanks for posting this

    ReplyDelete
  12. I really should have been a little more aggressive dangit. I mean it’s not my mom that loves Paula

    ReplyDelete
  13. work that is really inspiring to us.from you guys and continue that good

    ReplyDelete
  14. the attempt you put into your site. When thorough on this topic. I will try back in the future and see if you have more articles.

    ReplyDelete
  15. , I appreciate the information and the effort you put into your site.when searching on this topic.I w

    ReplyDelete
  16. . There is a company that you can get traffic from and they let you try it for free. I managed to ge

    ReplyDelete
  17. f topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding expertise so I wanted to get guidance from someone with

    ReplyDelete

Please, no abusive word, no spam.