Arrays

Import

// not needed nut provides useful stuff
import java.util.Arrays;

// example
Arrays.toString(arr);

Basic

int[] arr = {0, 1, 2, 3};
// ^ treat this as its own data type, like for function types int[]

int[] arr = new int[5];
// the size is fixed, max index = 4

Index

arr[1]

Length

arr.length;
// yep, not even a function... how nice is that!!!

2D arrays

int[][] arr;

int[][] arr = new int[3][5];

arr = {{1,2}, {3,5}};

arr[1][4];

// to print it
Arrays.deepToString(arr)