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[]) { Setset = 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.
8 comments: on "Unknown Java Traps that most of us fall in, Video Inside"
thanks semsem for this topic
keep on keep forward
You are welcome man :)
Very interesting :-D! thanks for share it!
@Gaby
you are welcome .. thanks for support and wait the next ;)
مشكوووووووووووووووووووووووووووووووووووووووووووووووووور
@Anonymous
you are welcome :)
Nice one. Great work Islam :)
Thanks Ahmed for your support
Post a Comment