Venu Chakravorty wrote:There is a difference between the two programs, the first one uses var-args while the second one doesn't. Have you thought about that?
I dont' want to compare the 2 examples that obviously are different, but only to understand why (...which rule we can apply) the compiler does not choose the second method declaration: void doSome(long... params){... do some work} instead of an error compilation. Both of the methods use var-args: the first one uses Boxing the second one widening, with non-var-arg method arguments (second example) the compiler chooses the second one with var-args an error code ...
Thanks again.