I think you already have what works. But the reason why
instruments.put("EURUSD", {"4001","EURUSD","10000","0.00001","0.1","USD"});
does not work because {"4001","EURUSD","10000","0.00001","0.1","USD"} . {} is syntactic sugar or a short shorthand in a Java array for initialization. It comes with the restriction that it should always go along with the statement of the declaration of the array, otherwise it is a syntax error.
Array declaration statement, e.g.
String[] array = {"1", "2"};
Thus, Java knows that the array that it must create for you actually consists of elements of type String .
If you violate the above statement as follows
String[] array; array = {"1", "2"};
It does not compile.
And with new String[]{"4001","EURUSD","10000","0.00001","0.1","USD"} compiler knows that he must create an instance of a new array whose element type is String ( new String[] ) and initialize the newly created array with the values โโyou specified ( {"4001","EURUSD","10000","0.00001","0.1","USD"} ).