This error message indicates that you are trying to use the method nextLine() with an object of the type Scanner, but the Scanner class does not have a method with that name.

To fix this error, make sure that you have correctly spelled the method name and that you are using it on an object that has the nextLine() method. For example, if you have a Scanner object named scanner, you can use the nextLine() method like this:

String line = scanner.nextLine();

If you are still getting the error, it is possible that you have not imported the Scanner class correctly. Make sure that you have imported java.util.Scanner at the beginning of your file

The method nextline is undefined for the type Scanner