use scanner.close() directly.