Exercise : Syntax errors

The following Java program has several errors. Can you find them all?
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
public class StringOops {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        System.out.print("Type your name: ");
        String name = console.nextString();
        process(name);
    }

    public static void process(string "name") {
        if (name == Brett) {
            System.out.println("You must be really awesome.");
        }
        replace("a", "e");
        toUppercase(name);
        name.substring(0, 3);
        System.out.println(name + " has " + name.length + " letters");
    }
}
Copy and paste the code into jGrasp and see if you can fix the errors.

Exercise - Corrected version

public class StringOops {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        System.out.print("Type your name: ");
        String name = console.nextString();
        process(name);
    }

    public static void process(String "name") {
        if (name.equals("Brett")) {
            System.out.println("You must be really awesome.");
        }
        name = name.replace("a", "e");
        name = name.toUpperCase();
        name = name.substring(0, 3);
        System.out.println(name + " has " + name.length() + " letters");
    }
}