How many access levels does Java have anyway?
Before I start with my new post, I would like to talk a little about my previous one: “Rule for public void method signatures“. As it turns out, this is a proposal for Java 7 called “chained invocations”. You can find more details here. There is also another way of doing this called “Double Brace Initialization“:
JPanel panel = new JPanel() {{ setLayout(new BorderLayout()); setBorder(BorderFactory.createEmptyBorder()); }};
At first site, it seems useful in a number of situations (i.e. Graphical User Interfaces), on the other hand, many suggest that this should not be abused as it creates ugly and cluttered code.
Now, let’s put that in the side and go back to what you have learned in Java programming.
Posted by Panagiotis Peikidis on 27 Nov 2008 - 1 Comment »
