Programming "Add Method" array seems to not be working
<p>Hi, I'm very new to java and I'm currently trying to create a student name and mark menu but I'm having trouble with my add method, I think it's something to do with my Arrays but I can't figure it out, any help would be appreciated.</p>

<p>Below is my <code>unitResult</code> method</p>

<pre><code>public class UnitResults 
{
    private String unitTitle;
    private String [] fName;
    private String [] surname;
    //private String [] UnitResults;
    private int [] Marks;
    private int Mark;

    private int pointer ;

    private static String course = "HND Computing"; 

    public UnitResults(int Size,String title)
    {            
        this.fName = new String [Size];
        this.surname = new String [Size];
        this.Marks = new int [Size];
        pointer = 0;

        fName[pointer] = "Daniel";
        surname[pointer] = "Scullion";

        Marks[pointer] = 60;
        unitTitle  = title;

        pointer ++;
    }

    public Boolean add( String tempfName, String tempsName, int newGrade)
    { 
        if (pointer == fName.length)
        {
            System.out.println("The Students Database is full");
            return false;
        }

        else
        {
            fName [pointer] = tempfName;
            surname [pointer]  = tempsName;
            Marks[pointer] = newGrade;

            pointer ++;
            return true;
        }
    }// end Add
</code></pre>

<p>but when I try to add this using a menu system below</p>

<pre><code>int option = 0;
option = menuSystem();

while (option != 6)
{
    System.out.println("");
    switch(option)
    {
    case 1:
        System.out.println(" Please Enter The Students First Name");
        String tempfName = keyb.nextLine();

        System.out.println("Please Enter The Students Last Name");
        String tempsName = keyb.nextLine();

        System.out.println(" Please Enter The Students Mark");
        int newGrade = keyb.nextInt();
        myUnit.add(tempfName, tempfName,newGrade);   

        break;
</code></pre>

<p>When I enter my option 1 the output that I get is :</p>

<pre><code>Please Enter The Students First Name

Please Enter The Students Last Name
</code></pre>

<p>Any ideas what's wrong here been searching for a long time, probably something simple but I've no idea :/</p>

<p>Edit: below is my menu class</p>

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

public class MenuResults {
    static Scanner keyb = new Scanner(System.in);

    public static int menuSystem()
    {
        System.out.println("*********************************");
        System.out.println("                                 ");
        System.out.println("1.Add New Student");
        System.out.println("2.Display Students Details");
        System.out.println("3.Delete a Students");
        System.out.println("4.Update Student Details");
        System.out.println("5.Sort Students By Mark");
        System.out.println("6.Sort Students By Surname");
        System.out.println("7.Search For A Student");
        System.out.println("                                 ");
        System.out.println("**********************************");

        System.out.print("\n Enter choice:");
        int option = keyb.nextInt();
        return option;
    }

    public static void main(String[] args) {
        UnitResults myUnit = new UnitResults(3, "Java");

        int option = 0;
        option = menuSystem();

        while (option != 6)
        {
            System.out.println("");
            switch(option)
            {
            case 1:                   

                System.out.println(" Please Enter The Students First Name");
                String tempfName = keyb.nextLine();

                System.out.println("Please Enter The Students Last Name");
                String tempsName = keyb.nextLine();

                System.out.println(" Please Enter The Students Mark");
                int newGrade = keyb.nextInt();
                myUnit.add(tempfName, tempsName,newGrade);   

                break;
            case 2:
                myUnit.display();
                break;
            case 3:

                break;
            case 4:

                break;
            case 5:

            case 6:

                break;
            default:
                System.out.println(" Invalid Entry");
            }//end switch 
        }
    }
}
</code></pre>

<p>There is my whole menu class as asked for.</p>

<p>EDIT: when I forget the user input and hard input it using: <code>myUnit.add("John","tommy",12);</code></p>

<p>I get <code>"Student Database is full"</code> about one hundred times..</p>
