What will be printed out as a result of the following code execution / compilation?

public class Test {
    static void m(int ... a) {

    static void m(Integer ... a) {

    public static void main(String[] args) {
        m(1, 2);
Both methods m (int ... a), and m (Integer ... a) can be applied for an m (1,2) method call. None of these methods is the most specific one, so there a compiletime error will occur (an ambiguous methods).
PS: Earlier versions of JDK8 contained an error, due to which the given code successfully compiled contrary to specifications.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по Java
Зарегистрируйся сейчас
или Подпишись на будущие тесты