Q:

Java: How to have if statements read both numbers and words

I'm trying to make a program of mine have if statements understand both words and numbers, now the converting doubles to strings, and Strings to doubles is not a problem, but where the problem lies is that when the user enters "restart" the program will not go to my restart menu (restart01();), it'll be going to either } else if (Grd1<5) { or } else {, please help me...
Here's my program (more in depth, when you see the full thing), but this is one of 5 parts (that look alike) where I'm having the program...
public static void Gdr1() {
        try {
            System.out.print("[Code: Gdr1]  Grade 1: %");
            Scanner gdr1 = new Scanner(System.in);
            Z = gdr1.next();
            Z = Double.toString(Grd1);
            Grd1 = Double.parseDouble(Z);
            if ((Grd1<100)&&(Grd1>=5)) {
                Gdr2();
            } else if ((Grd1>=100)&&(Grd1<125)) {
                System.out.println("    System> Great Job "+Stu+"!");
                Gdr2();
            } else if (Grd1<5) {
                System.out.println("I'm sorry, the lowest grade I am allowed to compute is 5...");
                Gdr1();
            } else if (Z.equalsIgnoreCase("restart")) {
                restart01(); 
                //This is the only part that doesn't work...
            } else {
                System.out.println("("+Z+") cannot be resolved in my system...");
                Gdr1();
            }
        } catch (Exception e) {}
    }

Now everything does work in the program, besides for when the End-User's input = " restart", I know some of the code in the program seems complicated, but it does work (most of it), can anyone help me try to figure this out, it's for my portfolio at my school due latest by 1/25/2017 @ 11:59 pm.
The things like Z (constant String), ""+Stu+"" (variable input), and [Code: Gdr1] (for restart menu) are there for other purposes in the program that require them to be there, well except for [Code: Gdr1] that's there only for the restart menu...

A:

Z = gdr1.next();
Z = Double.toString(Grd1);

You read from the scanner, but then directly overwrite the value you just read with the second line, effectively discarding it and instead using the value your static Double Grd1 was initialized with.
Removing this second line would solve your immediate problem, but then you will encounter another problem : now Z will sometimes be the "restart" String, and the next line's Double.parseDouble(Z) will fail.
As Ninad Shaha mentionned in his answer, you should check whether the String is "restart" before attempting to parse it as a Double. As NoDataFound mentionned in his answer, it would also be more elegant to check if the next token to be read by the Scanner is a Double beforehand.
In conclusion, here's how I would do it :
System.out.print("[Code: Gdr1]  Grade 1: %");
Scanner scanner = new Scanner(System.in);
if (scanner.hasNextDouble()) {
    // it's a Double
    Double d = scanner.nextDouble();
    /*
      conditions based on the double
    */
} else if (scanner.hasNext()) {
    // it's not a Double, so it may be "restart"
    String s = scanner.next();
    if ("restart".equalsIgnoreCase(s)) {
        restart01();
    } else {
        System.out.println("("+s+") cannot be resolved in my system...");
        Gdr1();
    }
}
// else we've read everything, we're done

Other notes :

Your naming conventions are terrible and won't help you debugging your code. You've got 3 grd1 / Grd1 : a function, a scanner and a static Double variable. Take the time to correctly name your variables, it will help you in the long run.
I don't think you have any reason to use static variables here, so you should avoid them. It may be hard to understand and manage the scope of your variables at first, but it's a necessary skill.
You should also avoid using recursion when it doesn't make sense. Here it won't be problematic, but if you keep this habit you'll soon encounter your first StackOverflowError.
there's no reason to catch exceptions if you're not going to do anything with them. You should instead modify your method's signature to declare what exceptions it can throw (Exception if you're lazy and your IDE can't help, but specific subclass are better : more informative to the people calling your method, plus your code won't compile anymore if you've added an operation that raises a new kind of error)

