Getting input from user about 2×2×2 Rubik's Cube state
You can store the sides on an array and loop over that, something roughly like this:

import java.util.Scanner;

public class scanCube {

    public static void main(String[] args) {
        String[] sides = { "TOP", "LEFT", "FRONT", "RIGHT", "BACK", "BOTTOM" };
        int side_index = 0;
        Scanner in = new Scanner(System.in);

        int[][] input = new int [6][4];
        System.out.println("Welcome to the 2x2x2 cube solver :)\n \n"
                + "Please enter your cube");

        for (String side: sides) {
            System.out.println("Enter the colors for the " + side + " side");
            System.out.println(" 0 = white \n 1 = orange \n 2 = green \n 3 = red\n 4 = blue\n 5 = yellow\n");
            int counter = 0;
            while(counter &lt; 4){
                input[side_index][counter] = Integer.parseInt(in.nextLine());
                counter++;
            }
            side_index++;
        }
    }
}


I would personally add a String.split so that the user can input the numbers for a single side on a single line, without having to hit enter every time.

If you want to have an alternative approach, with this the user can enter something like 0312 and it will be split and assigned to the array.

Keep in mind that this is just the general idea, not complete / nice code.

import java.util.Scanner;

public class scanCube {
    public static void main(String[] args) {
        String[] sides = { "TOP", "LEFT", "FRONT", "RIGHT", "BACK", "BOTTOM" };
        int side_index = 0;
        int max_colors_per_side = 4;
        Scanner in = new Scanner(System.in);

        int[][] input = new int [sides.length][max_colors_per_side];
        System.out.println("Welcome to the 2x2x2 cube solver :)\n \n"
                + "Please enter your cube");

        while (side_index &lt; sides.length) {
            System.out.println("Enter the colors for the " + sides[side_index] + " side");
            System.out.println(" 0 = white \n 1 = orange \n 2 = green \n 3 = red\n 4 = blue\n 5 = yellow\n");
            String[] side_colors = in.nextLine().toString().split("");

            if (side_colors.length != max_colors_per_side+1) { // Account for CR/LF
                System.out.println("Invalid input!");
            } else {
                for (int i = 1; i &lt;= max_colors_per_side; i++) {
                    // You should check here also that the input is valid (0..3)
                    input[side_index][i-1] = Integer.parseInt(side_colors[i]);
                }
                side_index++;
            }
        }
    }
}


You should also check that the user didn't input something presumably wrong like a cube with 10 white squares, because the amount of squares should be the same for every color.