Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
assert keyword
:
Content language: 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
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes