1. Initialize Array#

int[] array = new int[size];

2. Copy an Array#

int[] newArray = oldArray.clone();

3. Conversions#

  • String to Character Array
    char[] arr = str.toCharArray();
  • Character Array to String
    String str = new String(char[] arr);
  • Integer to String
    String str = Integer.toString(int n);
  • String to Integer
    int n = Integer.parseInt(String str);
  • Integer to Binary String
    String str = Integer.toBinaryString(int n);
  • Get number of set bits in a integer
    int n = Integer.bitCount(int x);