In Java
, is there any way to create a array of elements in range?
For example,
new int[] {1:10}, which should be equivalent to,
new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
I was thinking, if we need to create a array of large range elements (5-1000), rather than writing it like 5, 6, ..., 1000, if there is way like 5:1000.