Post

@EclipseJavaIDE @java No compile error. No runtime error (int wraps to -2^31). Output is "1". Java chooses the more specific version of the method, which is X(int, int), not X(int...)
English

@EclipseJavaIDE @java Seems like a kiddo is playing around with ur Eclipse putting unwanted semicolons .

English

@EclipseJavaIDE Method name in uppercase?? This is Java not C#!
English

@EclipseJavaIDE @java Someone will hit you very hard for not following ANY of the Java conventions. That’s what.
English

@EclipseJavaIDE “1” .. max+1 will produce integer value (-ve)
English

@EclipseJavaIDE You are too unspecific.
Eclipse version, Java jdk vendor, jdk version, jdk patch level, jvm, jvm args, OS name, OS version, CPU vendor, CPU name, motherboard, RAM spec.
How do you start the Prog. Left or right mouse button or touch.
With all come back, I've more questions. ;-)
English

@EclipseJavaIDE No error!
This code will run (compilation and execution) without any output error.
The first method is choosen. Printed result *l*
English

@EclipseJavaIDE 1, it will first match to the overloaded method with 2 parameter rather than with the var-args parameter
English

@EclipseJavaIDE Answer is "1". The most specific function is chosen.
English


























