parse() not a static method. This is an instance method. You need to instantiate DateFormat and then call parse() on that instance:
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date gameDate = dateFormat.parse(scanner.nextLine());
The static method belongs to the class. It makes no sense to call Person.getName() . But it makes sense to call
Person pureferret = new Person("Pureferret"); String name = pureferret.getName();
source share