I watched yesterday awesome tutorial that you deserve to see.
It's about Traps, Pitfalls, and Corner Cases in our lovely language, Java, It deals with 8 issues that most of us fall in it, Not to talk too long, I'll show you the first easy example and let you discover the rest and the reasons at this awesome video introduced by Google.
Problem One:
Here is a Java code and the question is to find the output and the reason of your selection, there are 4 multiple choices to select one from it, let's dance :)
The Options is :
for any questions, I'll be here and hope to enjoy the tricks.
read more...
It's about Traps, Pitfalls, and Corner Cases in our lovely language, Java, It deals with 8 issues that most of us fall in it, Not to talk too long, I'll show you the first easy example and let you discover the rest and the reasons at this awesome video introduced by Google.
Problem One:
Here is a Java code and the question is to find the output and the reason of your selection, there are 4 multiple choices to select one from it, let's dance :)
public static void main(String args[]) {
Set set = new HashSet();
for (short i = 0; i < 99; i++) {
set.add(i);
set.remove(i - 1);
}
System.out.println(set.size());
}
The Options is :
- 1.
- 99.
- Through an Exception.
- None of the above.
You will find the detailed solution with reasons at the first 5 minutes of the video.Now, I'll let you with the awesome video by Josh Bloch and Bill Pugh.
for any questions, I'll be here and hope to enjoy the tricks.

































