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:
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:
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 ?
In what order are initializing blocks executed in Java ? Here is a quiz to test your understanding :
This quiz about Inner classes and what all they can access from the parent class or method:
We use equals() method frequently for comparing objects.
How do they work on Strings and StringBuffers ? Test your understanding with this puzzle :
You may also like the following articles :
Thanks for visiting and all the valuable comments.
© 2016, www.topjavatutorial.com. All rights reserved. On republishing this post, you must provide link to original post