𝗝𝗮 v𝗮 𝗙𝗶𝗹𝗲 𝗛𝗮𝗻𝗱𝗹𝗶𝗻𝗴 Java file handling is about working with files. You can create, read, write, or delete files. This helps your program save and use information on your computer.
You need file handling to:
- Store data permanently
- Read and write data for later use
- Share data between programs or systems
- Organize large data
Java has the File class to support file handling. You can use this class to:
- Create a file with createNewFile()
- Write to a file with FileWriter and its write() method
- Read from a file with FileReader or InputStream
- Check if a file is readable with canRead()
- Check if a file can be written to with canWrite()
- Check if a file exists with exists()
- Get a file's path with getAbsolutePath()
- Delete a file with delete()
Source: https://dev.to/mohamed_ajmal_2/java-file-handling-6oe