Generating reverse words
<p>i am a beginner in java and i am doing practiceit questions off the internet.I tried attempting the question but i dont understand the error.</p>

<p>Write a method called processName that accepts a Scanner for the console as a parameter and that prompts the user to enter his or her full name, then prints the name in reverse order (i.e., last name, first name). You may assume that only a first and last name will be given. You should read the entire line of input at once with the Scanner and then break it apart as necessary. Here is a sample dialogue with the user:</p>

<p>Please enter your full name: Sammy Jankis
Your name in reverse order is Jankis, Sammy</p>

<pre><code>public static void processName(Scanner console) {
    System.out.print("Please enter your full name: ");

    String full=console.nextLine();

    String first=full.substring(0," ");
    String second=full.substring(" ");

    System.out.print("Your name in reverse order is: "+ second + "," + first);

}
</code></pre>

<p>Maybe i will go about explaining my code.So i try to break the two words apart.So i use substring to find the both words and then i hardcode to reverse them.I think the logic is right but i still get these errors.</p>

<pre><code>Line 6
You are referring to an identifer (a name of a variable, class, method, etc.) that is not recognized. Perhaps you misspelled it, mis-capitalized it, or forgot to declare it?
cannot find symbol
symbol  : method substring(int,java.lang.String)
location: class java.lang.String
    String first=full.substring(0," ");
                     ^
Line 7
You are referring to an identifer (a name of a variable, class, method, etc.) that is not recognized. Perhaps you misspelled it, mis-capitalized it, or forgot to declare it?
cannot find symbol
symbol  : method substring(java.lang.String)
location: class java.lang.String
    String second=full.substring(" ");
                      ^
2 errors
33 warnings
</code></pre>
