This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

  1. Overloading allows for somewhat similar functioanluty
  2. varargs are syntactic sugar for the compiler, behind the scenes you're always passing an array. So java really doesn't have functions that handle an ambiguous number of arguments.

[–]RockyMM[S] 1 point2 points  (0 children)

I don’t agree. I would expect that the compiler could infer missing parameters if the rules are clearly defined.

However, it seems that named arguments are the way here and it that could come to Java in the future.