Тести
Мова сайту: Українська
Українська
English
Русский
Тести з програмування
Вхід
Реєстрація
Тести з програмування
Теорія
Сніпети
Статті
Головна
Android
Ціни
FAQ
Історія Cosmo
Правила та умови сервісу
Політика конфіденційності
Політика щодо файлів cookie
Зворотній Зв’язок
visibility and scope
:
Мова контенту: English
Русский
What is the result of the following program compilation and execution? public class Test { public static void main(String[] args) { int i = 1; long j = 1; if (i == 1) { int k = 1; if (i == k) { System.out.println("i equals k"); } } else if (j == k) { System.out.println("j equals k"); } } }
visibility and scope
What is the following program`s execution result? class Tack { static short s = 17; public Tack(short ss) { new Tack(); s *= ss; } public Tack() { ; } } public class Bridle extends Tack { public Bridle(int s) { System.out.println(s + 1); } public static void main(String[] args) { Bridle b = new Bridle(3); } }
visibility and scope
What will be the result of the main method in the Main class execution? public class Main { private int anInt = 4; public Main() { anInt = 5; } public static void main(String[] args) { Main m = new Main(); int anInt = 6; m.print(anInt); } public void print(int anInt){ System.out.println(anInt); } }
visibility and scope
← Попередня
1
Наступна →
Зареєструйся Зараз
або
Підпишись на майбутні тести