0% found this document useful (0 votes)
6 views1 page

Java File Operations and Directory Management

The document demonstrates methods of the File class in Java like isFile(), getName(), canRead(), length(), mkdir(), getPath(), createNewFile(), isDirectory(), list() to check, create and list files and directories.

Uploaded by

Kabi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Java File Operations and Directory Management

The document demonstrates methods of the File class in Java like isFile(), getName(), canRead(), length(), mkdir(), getPath(), createNewFile(), isDirectory(), list() to check, create and list files and directories.

Uploaded by

Kabi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

File ob=new File("/java","sample.

txt");
[Link]();
[Link]();
[Link]();
[Link]();
[Link]();
File obdir= new File("/java/md");
[Link]();
[Link]();
[Link]();
File ob1=new File("/java/md","[Link]");
[Link]();
[Link]();
String m[]=[Link]();

for(int i=0;i<[Link]();i++)
SOP("The file in directory ",m[i]);

File ob1= new File("/java/pgm");


File ob2= new File("/java/pgm", "[Link]");
File ob3= new File(ob1, "[Link]");

You might also like