Evening all. I am a complete beginner to programming with Java, and I am learning about "Scanner", but when I type this basic code into Eclipse, I get a message saying "Resource leak:'scanner' is never closed.
What am I doing wrong?
package inputting;
import java.util.Scanner;
public class Input {
public static void main(String args[]) {
Scanner scanner = new Scanner(System.in);
System.out.println(scanner.nextLine());
}
}