I'm writing a registration activity and I wanted to let users enter the registration date for storing the record but the problem is how do I get the date as input from user using scanner? Did this but it somehow says there's an error sorry I'm still new to java.
System.out.println(" Enter in following format : dd-mm-yyyy");
String regDate=s.nextLine();
SimpleDateFormat format=new SimpleDateFormat("dd-mm-yyyy");
Date regDate=format.parse(date);