Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.3K+ articles
Java
10.5K+ articles
Java-Functions
4.1K+ articles
Difference Between
3.6K+ articles
Java Programs
1.9K+ articles
Java-IO package
259+ articles
Java Examples
242+ articles
Java-I/O
75+ articles
Java-Files
66+ articles
java-file-handling
34+ articles
Java-File Class
53 posts
Recent Articles
Popular Articles
How to Create a Directory in Java?
Last Updated: 24 April 2025
In Java, creating a directory is a common operation when working with file system manipulation. Directories are used to organize files and other directories into a hierarc...
read more
Java
Java Programs
java-file-handling
Picked
Java-File Class
Java-Files
Java Examples
Java FileReader Class ready() Method with Examples
Last Updated: 11 March 2022
Java FileReader class is used to read data from the data file. It returns the data in byte format as FileInputStream class. This is a character-oriented class that is used...
read more
Java
Java-Functions
Picked
Java-File Class
Java File Class toString() Method with Examples
Last Updated: 08 March 2022
This method returns the pathname string of the File object is returned by the function toString() function. This method is the same as calling the Java IO getPath() method...
read more
Java
Java-Functions
Picked
Java-File Class
Java File Class equals() Method with Examples
Last Updated: 02 February 2022
The equals() method of Java File Class compares the pathname supplied in the argument to the pathname provided in the argument. If the parameter is not null and points to ...
read more
Java
Java-Functions
Picked
Java-File Class
Java File Class compareTo() Method with Examples
Last Updated: 02 February 2022
The compareTo() function compares two pathnames lexicographically. In Java, the method may be used to sort files. This type of activity is dependent on the system on which...
read more
Java
Java-Functions
Picked
Java-File Class
Java File Class toURI() Method with Examples
Last Updated: 02 February 2022
The toURI() method returns the URI that corresponds to the supplied URL. This method works similarly to the new URI (this.toString()). This abstract pathname is represente...
read more
Java
Java-Functions
Picked
Java-File Class
Difference Between getCanonicalPath() and getAbsolutePath() in Java
Last Updated: 03 June 2022
The getCanonicalPath() and getAbsolutePath() methods belong to java.io.File class in Java. And these methods are basically used to get the path of a file object in the sys...
read more
Java
Difference Between
Picked
Java-File Class
Files Class writeString() Method in Java with Examples
Last Updated: 05 February 2021
The writeString() method of File Class in Java is used to write contents to the specified file.Syntax:Files.writeString(path, string, options)Parameters: path - File path ...
read more
Java
Java Programs
Picked
Java-File Class
Files Class readString() Method in Java with Examples
Last Updated: 27 January 2023
The readString() method of File Class in Java is used to read contents to the specified file.Syntax:Files.readString(filePath)Parameters:path - File path with data type as...
read more
Java
Java Programs
Picked
Java-File Class
Difference Between getPath() and getCanonicalPath() in Java
Last Updated: 11 March 2024
getPath() method is a part of File class. This function returns the path of the given file object. The function returns a string object which contains the path of the give...
read more
Java
Java Programs
Picked
Java-File Class
Java Program to Get the File Extension
Last Updated: 22 October 2021
The extension of a file is the last part of its name after the period (.). For example, the Java source file extension is “java”, and you will notice that the file name al...
read more
Java
Technical Scripter
Java Programs
Picked
Java-File Class
Technical Scripter 2020
Java Program to Determine Number of Bytes Written to File using DataOutputStream
Last Updated: 03 June 2024
The Java OutputStream class, java.io.OutputStream, is the base class of all output streams in the Java IO API. An output stream accepts output bytes and sends them to some...
read more
Java
Technical Scripter
Java Programs
Picked
Java-File Class
Technical Scripter 2020
Difference Between getPath() and getAbsolutePath() in Java
Last Updated: 04 January 2021
getPath(): The getPath() method is a part of File class. This function returns the path of the given file object. The function returns a string object which contains the p...
read more
Java
Difference Between
Java Programs
Picked
Java-File Class
Java Program to Get the Attributes of a File
Last Updated: 04 January 2021
In Java, there are several packages and API's to perform a lot of different functions. One such package is java.nio.file. This package contains various methods which provi...
read more
Java
Java Programs
Picked
Java-File Class
FileOutputStream in Java
Last Updated: 10 March 2025
In Java, the FileOutputStream class is a subclass of OutputStream. It is used to write data to a file as a stream of bytes. FileOutputStream is commonly employed for writi...
read more
Java
Java-I/O
Java-File Class
1
2
3
4
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !