Algorithm to output the initials of a name
<p>I have just started the java programming and at the moment I am doing the basic things. I came across a problem that I can't solve and didn't found any answers around so I thought you might give me a hand. I want to write a program to prompt the user to enter their full name (first name, second name and surname) and output their initials.</p>

<p>Assuming that the user always types three names and does not include any unnecessary spaces. So the input data will always look like this : Name Middlename Surname</p>

<p>Some of my code that I have done and stuck in there as I get number of the letter that is in the code instead of letter itself.</p>

<pre><code>import java.util.*;
public class Initials
{
     public static void main (String[] args)
     {
        //create Scanner to read in data
        Scanner myKeyboard = new Scanner(System.in); 


        //prompt user for input – use print to leave cursor on line
        System.out.print("Please enter Your full Name , Middle name And Surname: ");
        String name = myKeyboard.nextLine();

                String initials1 = name.substring(0, 1); 
                int initials2 = name.

                //output Initials
                System.out.println ("Initials Are " + initials1 + initials2 + initials3);


     }
}
</code></pre>
