Given a long career in Java programming one ought to have encountered many surprise techniques in programming language syntax that reduces lines of code without sacrificing the correctness of the program. I have certainly come across many such gems in my career but below I am going to show two techniques that I particularly like.
1. Instantiation and member function Initialization
2. Sorting Collections
That’s all folks! I hope you enjoyed reading about these two techniques as much as I enjoyed writing.