A simple Dice Game Using only Static methods This is a simple dice game that requires you  to get two numbers from the user and then it generates 15 other numbers and checks if the generated numbers are the same as the numbers typed in.

Try to run it on your IDE it will look more cool.

As seen below  I have  used only static methods:

import java.util.Random;

import java.util.Scanner;

public class DiceGame{

    static int first,second,dice;
    static int elments[] = new int [15]; 

    public static void main(String [] args){

        /*
        Hello Guys this is a simple dice game that requires you  type  two numbers from the user and then it
        generates 15 other numbers and checks if generated numbers are the same with your numbers typed in
        Try to run it on your IDE it will look more cool.
        As seen below  I have  used only static methods
        */

        getFirstNumberInput();
        getSecondNumberInput();
        validateFirstNumber();
        validateSecondNumber();
        generateDice();
        printAllelments();
        checkFirstNumberifSameAsGenerated();
        checkSecondNumberifSameAsGenerated();

    }

    static void getFirstNumberInput(){

        Scanner sc = new Scanner(System.in);

        System.out.print("\n type your first number from 1 to 6: ");
        first = sc.nextInt();
    }
    static void getSecondNumberInput(){
        Scanner sc = new Scanner(System.in);

        System.out.print("\n type your second number from 1 to 6 :");
        second = sc.nextInt();
    }
    static void validateFirstNumber(){
        if(first &gt; 6){
            System.out.print("\nyou cant type a number greater than 6");
            getFirstNumberInput();
        }else if(first &lt; 0){
            System.out.print("\n you cant type a negative number ");
            getFirstNumberInput();
        }else{
            validateSecondNumber();
        }
    }

    static void validateSecondNumber(){
        if(second&gt; 6){
            System.out.print("\nyou cant type a number greater than 6");
            getSecondNumberInput();
        }if(second &lt; 0) {
                System.out.println("\nyou cant type a negative number");
                getSecondNumberInput();
            }else {
                generateDice();
            }
        }

    static void generateDice(){
        Random generate = new Random();

        for(int iterator = 0; iterator &lt; 15; iterator++){
            dice = 1+generate.nextInt(6);
            elments[iterator] = dice;

            }

    }

    static void printAllelments(){
        for(int i = 0;i&lt;=14;i++){
            System.out.print(elments[i]+"\t");

            if(i % 5 == 0){
                System.out.println("\n\n\n\n");
            }

        }
    }

    static void checkFirstNumberifSameAsGenerated(){

            int same = 1;
        for(int i = 0 ;i&lt; elments.length;i++){
            if(elments[i] == first){
                System.out.println();
                System.out.println("your  first number that you typed : [ "+first+" ] is the same as this [ "+elments[i]+" ] that was generated  { "+
                                    same+++" } similar numbers");

            }
        }
    }
    static void checkSecondNumberifSameAsGenerated(){

            int same = 1;
        for(int i = 0 ; i&lt; 15;i++){
            if(elments[i] == second){
                System.out.println();
                System.out.println("your second number that you typed : [ "+second+" ] is the same as this [ "+elments[i]+" ] that was generated  { "+
                                    same+++" } similar numbers");

            }
        }
    }

}
Here's my list of points (don't be discouraged by it):


You have multiple functions which appear to do similar things with only minute differences. For example, getFirstNumberInput() and getSecondNumberInput() appear to be the same, however one uses the word "first" in its print and the other uses "second". So that you avoid repeating your code, I would create a single function which can handle both operations. Either you pass in the text "first" or "second" as an input to that function, or you reword the print to make those words unnecessary to state (for example "Enter a number from 1 to 6").
Don't forget to close your scanners when you're done with them.
Not sure if this was an issue you faced when copying your code into the question, but if it isn't then you should also sort out your indentations by having indentation before closing braces line up with the indentation of the line where the matching opening brace was.
Your code uses recursion for the validation - I would recommend changing it so that the input is not accepted until a valid value is provided, rather than sending your program into a potentially infinite stack of function calls. This means that you should use an until loop to check if input is valid before moving out of the loop and setting the input value.
Your code uses class variables when it doesn't need to - the scope of the variables should be restricted to main and then the functions should return values which will be assigned to the variable, so rather than what you currently have you end up with int firstInput = getInput(). I would never personally have the function itself assign a value, but rather it should always return a value which the main method can handle.
Variable naming is important. Whilst this is quite a small program, and a programmer would easily be able to look at the code to see how your variables are being used, it would be much clearer for someone to see a variable called "firstInput" rather than "first". Concise variable names are important.
Despite the fact that you call validateSecondNumber as part of the main method, you call it within the validateFirstNumber method as well. Not only does that mean that the method runs more times than it needs to, but you shouldn't really be calling validateSecondNumber from validateFirstNumber. Each method should only do the task it is set - therefore, validateFirstNumber should only validate the first number. It should not also validate the second number.
Due to the way your validateSecondNumber program logic is handled, if you enter a value above 6 multiple times then it will be accepted as a valid input after a few tries.
You should validate inputs as you receive them, so there is no confusion for the user, rather than getting both inputs and then validating them.
A minor point at this stage, but it builds off of what I said about a method only handling what it is designed to. Many of the methods here use prints to tell the user of a mistake that has been made. Instead (in the case of validation routines), you should simply make the main method aware of the mistake made, such as inputting a value that is below zero, and having the main method handle it. This can be in the form of throwing a relevant exception and allowing the main method to catch that and handle it.
You ask for a value inclusively between 1 and 6, but also seem to accept 0 as a valid input. This is because you check if the input &lt; 0 instead of &lt;= 0.
In your last routine, you typed same+++. Instead, I would increment the variable on a separate line to avoid confusion due to multiple plus signs.
\n isn't always enough to present a new line, depending on the environment which the program is running in. Use \r\n for more certainty that it will work on all platforms. The best thing to do would be to get the line.separator property and use that in place of \n.
Unless you have been given a task which specifically says to use only static methods, I would avoid that approach in the future.