+ 2
-Part 2
File is the File class, and the constructor is what instances an object. A constructor can have parameters to specify what kind of object is being created, or the required data to instance the object (you don't have to know the details of this right now, you will learn later on)
To create a File object, one of the constructors (the one you're using) requires the file path, which accepts it as a string (double quotes.)
That is what it means by needing to "specify a path of the file for the constructor"
Example of instancing a File object:
File inFile = new File("C:/User/Name/Documents/Data.txt");
You can tell when you're using a constructor/instancing(creating) an object with the "new" word.
Think of it like creating a "new" object.
If you want to see what methods your object can use, here's a link of the list https://docs.oracle.com/javase/7/docs/api/java/io/File.html
Hopefully it's understandable and I didn't get anything wrong.
+ 2
-Part 1
A directory is also called a folder.
The path is where a file is located.
E.g. C:/User/Name/Documents/Data.txt
The C: is the C: drive (this could be different based on the drive and the OS I believe, such as F: drive E: drive etc. It is the Hard drive or SSDs), in the C: drive there is a User folder (directory), in the User folder there is a Name folder (the account on the computer you're using. e.g. Alex), in the Name folder there is a Documents folder, and in the Documents folder there is your Data.txt. This is a path to your data, which your program needs to locate it.
If your program is in, lets say, the Documents folder, and if the file you are pathing is in the same folder (YourProgram.java and Data.txt are both in the Documents folder), you don't have to type the whole path. You could just type "Data.txt", or if its in another folder inside of the Documents folder then I'd be "/DataFolder/Data.txt".
If your data is in a completely different folder, you will have to specify the whole path.
0
Ashwin Burnwal are u talking about path in data file handling