Тесты
Язык сайта: Русский
Українська
English
Русский
Тесты по программированию
Вход
Регистрация
Тесты по программированию
Теория
сниппеты
Статьи
Главная
Android
Цены
FAQ
История Cosmo
Правила и условия сервиса
Политика конфиденциальности
Политика в отношении файлов cookie
Обратная Связь
assert keyword
:
Язык контента: English
Русский
The following class was launched with a -ea key. What is the result of following code execution? public class Test { public static void main(String [] args) { Boolean b = true; int i = 10; String str = "Hello World"; assert (b == true) : "true"; assert (i != 10) : "false"; System.out.println(str); } }
assert keyword
What will the following code print out: public class Comparation { public static Boolean assert(boolean bool) { return bool; } public static void main(String[] args) { int i1 = 1; Integer i2 = 1; System.out.println("assert=" + assert(i1 == i2)); } }
assert keyword
Given a program: public class SomeClass { public static void main(String... args) { Boolean b = true; assert(!b) : "yo "; System.out.println("hi"); } } and a command line to start: java SomeClass What will be the result?
assert keyword
← Предыдущая
1
Следующая →
Зарегистрируйся сейчас
или
Подпишись на будущие тесты