File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

var arg in method

 
saravanan ragunathan
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


when i pass the primitive variables such as c or b with reference of int array
object(a) i am getting error ...why
 
Matthew Brown
Bartender
Posts: 4549
8
Java Netbeans IDE Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The var-arg method will take either an int array, or any number of int parameters. But you can't mix them.
 
saravanan ragunathan
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why the java developers avoids this
is there any performance degradation..any other reason
 
Matthew Brown
Bartender
Posts: 4549
8
Java Netbeans IDE Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's just how the language is designed. And there are pretty good reasons for the design - you'd run into problems with overloaded methods where it was ambiguous which version was called. But fundamentally, this is one of those questions where the answer is "because that's how it works".

 
saravanan ragunathan
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for sharing information ...

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic