Capitalization Java Program
<p>The directions that were given were:
   Write a program that prompts for and accepts a line of text from the user, and then prints it out with every character in lower case except for the characters that are immediately after a space. These characters are to be capitalized. </p>

<p>NOTE: don't split the string</p>

<ul>
<li>Accept a string from user</li>
<li>Turn all characters to lower case</li>
<li>Go through each character individually and capitalize the characters after the spaces</li>
</ul>

<p>My Current Code:</p>

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

public class Capitalize
{
public static void main(String[] args)
{
    Scanner input = new Scanner(System.in);
    System.out.print("Enter a line of text:");
    String TextLine = input.next();
    //String FirstLetter = input.next();
    String NewTextLine = " ";
    int Length = TextLine.length();
    System.out.print("The all lower case line of text is: " + TextLine);
    for(int i = 0; i &lt; Length; i++)
    {
        char Letter = TextLine.charAt(i);
        System.out.print(Letter);
        if(Letter != ' ') 
        {
            Letter = Character.toLowerCase(TextLine.charAt(i));
        }
        else
        {
            Letter = Character.toUpperCase(TextLine.charAt(i));
        } 
        NewTextLine = NewTextLine + Letter;
        }
        System.out.print("\nThe new text line of text is: " + NewTextLine);
    }
}
</code></pre>

<p><strong>The Output Is:</strong></p>

<p>Enter a line of text: aBc Def GHIJ 
The all lower case line of text is: aBcaBc
The new text line of text is:  abc</p>

<p>This isn't what I want to get as the output. 
I want to take " aBc DeF GHIJ " and get the out put of all lower case " abc def ghij " and the new text line to be " Abc Def Ghij "</p>

<p>Can someone please help me to figure out where I went wrong with my code? And how to fix it. </p>
