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

Files Command

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)
23 views1 page

Files Command

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
You are on page 1/ 1

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

txt");
ob.isFile();
ob.getName();
ob.canRead();
ob.canWrite();
ob.length();
File obdir= new File("/java/md");
obdir.mkdir();
obdir.getName();
obdir.getPath();
File ob1=new File("/java/md","sample.txt");
ob1.createNewFile();
ob1.isDirectory();
String m[]=ob1.list();

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

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


File ob2= new File("/java/pgm", "sample.txt");
File ob3= new File(ob1, "sample.txt");

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy