Ask coding questions

← Back to all posts
Java File making and Reading

File Creation

So, I am currently learning how to use Java for coding and it was teaching about making files with code and reading them but to make the file you need to specify the location, how do i specify the location on replit? Like if i can figure that out i can figure the rest out as well.

Thanks in Advanced!

xxpertHacker (930)

You specify the file's location the exact same way on and off of Replit.

Replit doesn't have a special version of Java or anything.

Try the code that you has previously seen on Replit, likely, it'll work without modification.


@xxpertHacker I meant more like, lets say i have a txt file made in my repl how to i find the location so i can refer to it?

xxpertHacker (930)

@AIDUNRANDOLPH Via file path?

You can access data.txt via "./data.txt"