[Bluej-discuss] Problem with vararg parameters in Constructor

gumm@Mathematik.Uni-Marburg.de gumm at Mathematik.Uni-Marburg.de
Thu May 24 17:18:24 BST 2007


Consider the following class:

public class Test{   
    Test(int ... z){}
    static void test(int ... i){}   
}

While it is legal, and possible from the BlueJ environment, to call 
test() with an empty parameter list,
calling the constructor with empty parameter list, which is perfectly 
legal in Java, results in a BlueJ error:

    "An error occurred in a file for which the source cannot be found.
     class:source line number:
     java.lang.Class:2678
    NoSuchMethodException:Test.<init>()(in java.lang.Class)"


Greetings,

H.Peter Gumm



More information about the bluej-discuss mailing list