Wednesday, 16 January 2013

ArrayList initialization

A concise way to initialize ArrayList in Java using anonymous classe:    

 List<Class> array = new ArrayList<Class>(){{          
            add(CreateEvent.class);
            add(SendEvent.class);
        }};

No comments:

Post a Comment