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
typecasting
:
Content language: English
Русский
What will the following code print out to console? public class Exam { public static void main(String[] arg) { Object obj = null; String str = new String("str"); str = (String) obj; obj = new String("obj"); System.out.print(obj + ", " + str); } }
typecasting
What is the result of the following code compilation and execution? public class Test { public static void main(String[] args) { float f = 1.0 + 1.0f; f = f + 1; System.out.println(f / 0); } }
typecasting
byte x = 0; byte y = (--x<0) ? ++x : -x; System.out.println(y); Result of the code execution will be:
typecasting
Among the snippets of code below choose all that will compile successfully.
typecasting
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes