• Post Reply Bookmark Topic Watch Topic
  • New Topic

variable arguments are treated as array  RSS feed

 
Rashmi Jagannath
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is not possible to overload one method taking array argument
and another method taking variable argument
it becomes ambigous

how variable arguments are treated as arrays
 
Anubhav Anand
Ranch Hand
Posts: 341
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rashmi Jagannath,
Welcome to JavaRanch.

Well, varargs implicitly take arguments as arrays, that's why you faced that problem. Please refer sun's link for varargs for more details.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!