5 Comments

  1. Swapnil Chaudhari

    The explaination is wrong again. According to method overloading it will search for non-parameterized version of method method() bt matching signature of all method() methods. As it is not available, compilation will fail.

    Reply
    • admin

      Hi Swapnil, the explanation provided in the quiz is correct. Here, the compiler complains about the ambiguous methods and NOT the no-arg method.
      The vararg can also work for method calls that have no parameters.. vararg by definition can accept zero or more arguments.
      If you want to verify, you can comment one of the above methods and the code will compile and run fine.

      Reply

Leave a Reply