Java File class 📁

Published: 06 October 2020
on channel: Bro Code
89,279
3.8k

Java File class tutorial example

#Java #File #class #tutorial #example

import java.io.File;

public class Main {

public static void main(String[] args) {

// file = An abstract representation of file and directory pathnames

File file = new File("secret_message.txt");

if(file.exists()) {
System.out.println("That file exists! :O!");
System.out.println(file.getPath());
System.out.println(file.getAbsolutePath());
System.out.println(file.isFile());
file.delete();
}
else {
System.out.println("That file doesn't exist :(");
}
}
}


On this page of the site you can watch the video online Java File class 📁 with a duration of hours minute second in good quality, which was uploaded by the user Bro Code 06 October 2020, share the link with friends and acquaintances, this video has already been watched 89,279 times on youtube and it was liked by 3.8 thousand viewers. Enjoy your viewing!