What will the compilation result be?

package com.one;

import static com.two.Two.*;

public class One {
    int x1 = Two.tiger; //1
    int x2 = tiger;  //2
    int x3 = com.two.Two.tiger; //3
    int x4 = two.Two.tiger; //4
}
Second file:

package com.two;

public class Two {
    public static int tiger = 1414;
}
Explanation
Compiler will show two errors:
In line
int x1 = Two.tiger; //1
Because class Two is not imported, only static methods and variables are imported

And in line
int x4 = two.Two.tiger; //4
Because there is no package two

Следи за CodeGalaxy

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

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