Moving the first word to the last position in Java
<p>I am trying to move the first word to the last position in Java. But my program did not print the sentence. What could I be missing?</p>

<p>Here is my program: </p>

<pre><code>import java.util.Scanner;

public class FirstLast {

    public static void main(String[] args) {
        System.out.println("Enter line of text.");
        Scanner kb = new Scanner(System.in);
        String s = kb.next();
        int last = s.indexOf("");
        System.out.println(s);
        s = s.sub string(0, last) ";
        System.out.println("I have rephrased that line to read:");
        System.out.println(s);
    }
}
</code></pre>
