Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

my code wont accept the file path that i got, and keeps throwing fileNotFoundexception.

+4 votes
asked Dec 1, 2023 by Kayden Schaefer (160 points)

1 Answer

0 votes
answered Dec 5, 2023 by Peter Minarik (88,520 points)

Probably because you're referring to a local file on your machine, but OnlineGDB is running on a Linux server. It has no access to your local files.

You can add any file to your project (left of the RUN button) and you can provide a relative path to that file. See the "Random.txt" in this example added to the project.

If this does not help, please, share your code.

commented Dec 7, 2023 by Niraj (120 points)
File paths will be different. Change according to how you stored and referencing it even in your code if necessary
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.