Popular & Tricky Java Puzzles :
Boolean variables are the simplest.. They can just be True or False.
Can you predict what happens with the Boolean variables in this puzzle ?
We have a collection here.. we add some elements to it and remove them. But the results are not as expected.
Can you explain why ?
This puzzle is about method overloading. Could you identify which overloaded method will be called here ?
main() method is the entry point of a program in Java. But can a class call another class’s main() method ?? Find out in this quiz:
Java Quiz 15 (main() calling main())
For-each loop is a nice improvement over traditional for loop.
Test your understanding for this looping construct :
Predict the output of this switch statement:
Java Quiz 23 ( Switch statement)
In java, its possible to create methods with varargs that can take zero or more parameters.
How does method overloading behave when we have overloaded methods with variable arguments ?
Java Quiz 17 ( confusing overloading)
In what order are initializing blocks executed in Java ? Here is a quiz to test your understanding :
Java Quiz 29 (Order of initialization)
This quiz about Inner classes and what all they can access from the parent class or method:
Java Quiz 26 (Inner class access)
We use equals() method frequently for comparing objects.
How do they work on Strings and StringBuffers ? Test your understanding with this puzzle :
Java Quiz 30 (Strange Equality Test)
You may also like the following articles :
Thanks for visiting and all the valuable comments.
© 2016 – 2017, https:. All rights reserved. On republishing this post, you must provide link to original post