Double Brace initialization

It creates an anonymous class derived from the specified class (the outer braces), and provide an initializer block within that class (the inner braces). e.g.

new ArrayList() { { 
   add("you"); 
   add("me"); 
} }

No comments:

Post a Comment

Functional programming with Java - Part 1

 Recently I was reviewing one PR raised by team memeber and going through one utitlity method and found out there are too many muatable vari...