0

I have assignment to access file system using java program. In that , I want to create file, read file modify file etc (all operation we can do on file and directory as well).

Is there any way we can do using java program / or any api available to do these operations.

1 Answer 1

1

Use java.io.File and java.nio.file.Files. They don't care about which OS (Operating System) are you using. Also File wraps files and folders, check the methods File.isDirectory() and File.isFile().

NOTE: use also File.separator to standarize and avoid problems between OS

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.