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
ternary-operator
:
Content language: English
Русский
What will be printed out if the following code is compiled and executed? public class Main { public static void main(String s[]) { System.out.println(true ? false : true == true ? false : true); } }
ternary-operator
What is the result of the following code execution? 1: class Foo { 2: public static void main(String[] args) { 3: Integer i = 42; 4: String s = (i < 40) ? "life" : (i > 50) ? "universe" : "everything"; 5: System.out.print(s); 6: } 7: }
ternary-operator
byte x = 0; byte y = (--x<0) ? ++x : -x; System.out.println(y); Result of the code execution will be:
ternary-operator
What will be the result of compiling and running the following code? public class MyFirst { static public void main(String[] args) { //1 int a = 5; a = a!=0 ? a>1 ? a>>2 : a<<2 : a<1 ? a<<2 : a>>2; //2 System.out.println(a); } }
ternary-operator
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes