Embedded initializers like this are not supported by default in Java. Java has something similar, but it's not exactly the same.
Here's how you can define an embedded ArrayList string (using a technique called “double-bracket initialization”):
ArrayList<NPC> npcs = new ArrayList<NPC>() { { add(new NPC()); add(new NPC()); }};
As you can see, not very nice. You also actually instantiate the subclass of ArrayList instead of the ArrayList class.
Java typically uses the List<T> to define variables, so you can use any List implementation.
Consider this instead:
public WeaponsData(List<NPC> _drop, List<NPC> _buy, List<NPC> _sell) { }
Then you can do:
public static WeaponsData AngelicAxe = new WeaponsData( Arrays.asList( new NPC("Rat", "None", 0), new NPC("Dog", "None", 0) ), Arrays.asList( new NPC("Player", "All", 0) ), Arrays.asList( new NPC("Cain", "First", 5000) ) );
There is also a set of Google Guava libraries that has a very good collection library with many helper methods that help in creating and processing collections:
Check it out: http://code.google.com/p/guava-libraries/ and User Guide
source share