1int intArray[]; //declaring array
2intArray = new int[20]; // allocating memory to array
3//OR
4int[] intArray = new int[20]; // combining both statements in one
1int[] myIntArray = new int[3];
2int[] myIntArray = {1, 2, 3};
3int[] myIntArray = new int[]{1, 2, 3};
4
5// Since Java 8. Doc of IntStream: https://docs.oracle.com/javase/8/docs/api/java/util/stream/IntStream.html
6
7int [] myIntArray = IntStream.range(0, 100).toArray(); // From 0 to 99
8int [] myIntArray = IntStream.rangeClosed(0, 100).toArray(); // From 0 to 100
9int [] myIntArray = IntStream.of(12,25,36,85,28,96,47).toArray(); // The order is preserved.
10int [] myIntArray = IntStream.of(12,25,36,85,28,96,47).sorted().toArray(); // Sort
11
12
13/*
14* Nice cock
15*/