I was wondering if there is a way in java to initialize an array by listing its components. I could do it in c# like this:
int[] array = new int[10]{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
I tried this in java but it doesn't work, is there a way to do something similar?