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
Зареєструйся Зараз
або Підпишись на майбутні тести