I am a little bit puzzled by this:
void a(){
Log.d(TAG, "Noargs");
}
void a(int... s){
Log.d(TAG, "Varargs");
}
My first question is what will be logged if I call a();? Please try to guess because I am trying to illustrate the confusion with this. I tested it and the answer is in the end of the question.
The real question is then how does Varargs really work, how does JVM know which method you are calling since the way to call them is the same?
Also is there something in Java (or something planned) to allow for this
AS3 Code: function sayHello(somebody:String = “world”):void{}
//This allows you to specify default values of arguments and have them as optional
Answer is Noargs even Ecipse references this method.