I'm having an error reading in using Scanner. [ .nextLine() ]
See the below code, I am trying to read in a date and send it to the inputDate() method.
But the console doesn't allow me to and produces the error message
Enter the start date in the format dd/mm/yyyy - invalid format
Exception in thread "main" java.lang.NullPointerException
at java.util.Calendar.setTime(Calendar.java:1106)
at java.text.SimpleDateFormat.format(SimpleDateFormat .java:955)
at java.text.SimpleDateFormat.format(SimpleDateFormat .java:948)
at java.text.DateFormat.format(DateFormat.java:336)
at UseItem.inputDate(UseItem.java:103)
at UseItem.main(UseItem.java:56)
Java Code:
import java.util.Scanner;
import java.util.Arrays;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import java.text.SimpleDateFormat;
public class UseItem
{
	public static void main (String [] args) throws ParseException
	{
		Scanner keyboard = new Scanner(System.in);

		Item dvd1 = new DVD(0001, 2007, "Shrek 3", "PG", "Children", 1, 100, "Spanish");
		Item dvd2 = new DVD(0002, 2007, "Spiderman 3", "PG-13", "Thriller", 1, 140, "Portuguese");
		Item game1 = new Game(1001, 2016, "Fifa 17", "3+", "Sports", "Xbox", false);
		Item game2 = new Game(1002, 2014, "Call of Duty", "18+", "First Person Shooter", "PS4", false);
		Item vhs1 = new VHS(2001, 1942, "Bambi", "PG", "Children", "VHS-C", 70);

		Item [] items = new Item[5];

    	items[0] = dvd1;
    	items[1] = dvd2;
    	items[2] = game1;
    	items[3] = game2;
    	items[4] = vhs1;

		int choice;
		String startD, endD;

    	do
    	{
    		choice = menu();

    		if (choice == 1)
    		{
    			int itemChoice;
    			System.out.println("Here are all available items");
    			for (int x = 0; x < items.length; x++)
    			{
    				if (items[x].getAvailable() == true)
    					System.out.println((x+1)+". "+items[x].getTitle()+" ("+items[x].getClass().getSimpleName()+")");
    			}
    			System.out.println();
    			System.out.print("Enter your choice - ");
    			itemChoice = keyboard.nextInt();
    			System.out.println();
    			System.out.print("Reference = ");
    			int reference = keyboard.nextInt();
    			System.out.print("Customer Reference = ");
    			int customerRef = keyboard.nextInt();
    			System.out.print("Item Price = ");
    			double price = keyboard.nextDouble();

    			System.out.print("Enter the start date in the format dd/mm/yyyy - ");
    			startD = keyboard.nextLine();
    			System.out.print(inputDate(startD));
    		}

    		else if (choice == 2)
    		{

    		}

    		else if (choice == 3)
    			System.exit(0);

    		else
    		{
    			System.out.println("Error");
    		}
    	}

    	while (choice != 3);
	}

	public static int menu()
    {
    	Scanner keyboard = new Scanner(System.in);

    	int choice;

		System.out.println();
    	System.out.println("1. Hire an item");
    	System.out.println("2. Terminate a hire contract");
    	System.out.println("3. Exit");
    	System.out.println();

    	System.out.print("Enter your choice - ");
    	choice = keyboard.nextInt();
    	System.out.println();

    	return choice;
    }

    public static Date inputDate(String date)
    {
    	SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
		Date testDate = null;
		try{
		    testDate = df.parse(date);
		} catch (ParseException e){ System.out.println("invalid format");}

		if (!df.format(testDate).equals(date)){
		    System.out.println("invalid date!!");
		} else {
		    System.out.println("valid date");
		}

		return testDate;
    }
}