To work with files and directories java.io package has a class File , which has all necessary methods and constructors to work with Files and Directories. The object of File class can be used to handle both file and directory. You can create File object that will work as abstract representation of file or directory. There are following constructors used to create File object. 1. public File (String pathname) Creates a new File instance by converting the given pathname string into an abstract pathname. If the given string is the empty string, then the result is the empty abstract pathname. e.g . File f=new File (“ F:/java/programs ”); it creates File object that is abstract represantioan of directory , F:\java\programs. e.g. File f=new File (“ F:/java/programs/MyClass.java ”); it creates File object that is abstract represantioan of file MyClass.java File f=new File (“ F:/java/programs ”); ...
Future driven solutions.