To create directories we use two methods mkdir() and mkdirs(). The mkdir() method creates a directory, returning true on success and false on failure. Failure can occur for various reasons, such as the path specified in the File object already exists, or the directory cannot be created because the entire path does not exist ye. To create a directory for which no path exists, use the
mkdirs() method. It creates both a directory and all the parents of the directory.
Making Directories CODE import java.io.*; OUTPUT Directory exists DESCRIPTION In the above program at THINGS TO TRY
|