Java: Java Programming For Beginners a simple Start To Java Programming (Written By a software Engineer)


Download 0.82 Mb.
Pdf ko'rish
bet62/95
Sana09.01.2022
Hajmi0.82 Mb.
#261112
1   ...   58   59   60   61   62   63   64   65   ...   95
Bog'liq
Java Programming For Beginners - A Simple Start to Java Programming ( PDFDrive )

Making Directories:
There are two valuable File utility methods, which can be utilized to make directories:
The mkdirs() method makes both a directory and all the elements of the index.
The mkdir( ) method makes a directory, returning valid on achievement and false
on disappointment. Failure demonstrates that the way determined in the File object
exists, or that the index can’t be made in light of the fact that the whole way does
not exist yet.
Sample Implementation:
import java.io.File;
public class MyCreateDir {
public static void main(String args[]) {
String directoryname = “/tmp/user/java/bin”;
File dir = new File(directoryname);
dir.mkdirs();


}
}

Download 0.82 Mb.

Do'stlaringiz bilan baham:
1   ...   58   59   60   61   62   63   64   65   ...   95




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling