A concise way to initialize ArrayList in Java using anonymous classe:
List<Class> array = new ArrayList<Class>(){{
add(CreateEvent.class);
add(SendEvent.class);
}};
List<Class> array = new ArrayList<Class>(){{
add(CreateEvent.class);
add(SendEvent.class);
}};
No comments:
Post a Comment