chris yo
chris yo

Reputation: 1277

Declaring an array of int in xtend

How can I declare an array of int in xtend?

I've tried ArrayList but I get the error "The primitive 'int' cannot be a type argument".

Upvotes: 6

Views: 5284

Answers (1)

Sebastian Zarnekow
Sebastian Zarnekow

Reputation: 6729

Please refer to the docs for details, but essentially its something along these lines:

val int[] x = newIntArrayOfSize(5)

or if you want to define an array literal:

val int[] x = #[1, 2, 3]

Upvotes: 8

Related Questions