Basic Java - Please help a stressed noob with a method?
<p>My name's Ali, I have just started two units of study with the Open University, so I am entirely fresh-faced to Java. I am trying to get the following code to compile but the lack of support i'm getting from my tutor is horrendous and the several books I have splayed out across my room aren't helping me get going.</p>

<p>I have been given a method that I wish to answer some questions about:</p>

<pre><code>public char[] methodA()
{
    char[] alphas = {'s', 't', 'e', 'a', 'm'};
    char temp = alphas[0];
    int i = 0;

    while (i &lt; alphas.length - 1)//1
    {
        alphas[i] = alphas[i+1]; //2
        i++;
    }

    alphas[alphas.length-1]=temp;

    return alphas;
}
</code></pre>

<p>How do I get this to compile successfully using my IDE? I have tried just enclosing it within the syntax for my 'main' method but it's not accepting it.</p>

<p>Here is what I have at the moment:</p>

<pre><code>package openuniversity;

public class Main
{
    public static void main(String[] args)
    {
        public static char[] methodA()
        {   
            char[] alphas = {'s', 't', 'e', 'a', 'm'};
            char temp = alphas[0];
            int i = 0;

            while (i &lt; alphas.length - 1)//1
            {
                alphas[i] = alphas[i+1]; //2
                i++;
            }

            alphas[alphas.length-1]=temp;

            return alphas;
        }
    }
}
</code></pre>

<p>Thanks to anyone who can help.
Ali</p>
