Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java causing problem in input using scanner #7

Open
musawershah1598 opened this issue Aug 17, 2019 · 2 comments
Open

Java causing problem in input using scanner #7

musawershah1598 opened this issue Aug 17, 2019 · 2 comments

Comments

@musawershah1598
Copy link

When ever i run the code with below command having scanner in code.
java Hello < input.txt
My input file have all the inputs specify for each scanner it giving me the following error.
Exception in thread "main" java.util.NoSuchElementException: No line found at java.base/java.util.Scanner.nextLine(Scanner.java:1651) at Example.main(Example.java:7)

@shawon100
Copy link
Owner

Rename your class as Main. Import all kinds of library that supports Scanner.

@musawershah1598
Copy link
Author

musawershah1598 commented Aug 17, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants