Spring Expression - Array construction

Array construction 


Arrays can be built using the familiar Java syntax, optionally supplying an initializer to have the array populated at construction time.

int[] numbers1 = (int[]) parser.parseExpression("new int[4]").getValue(context); 
// Array with initializer 
int[] numbers2 = (int[]) parser.parseExpression("new int[]{1,2,3}").getValue(context); 
// Multi dimensional array 
int[][] numbers3 = (int[][]) parser.parseExpression("new int[4][5]").getValue(context); 

It is not currently allowed to supply an initializer when constructing a multi-dimensional array

Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept