Java program to distinguish between a file and a directory

Today, we are going to have an example that will help us to understand how we can distinguish folders or directories and files through Java Program. Java program to distinguish between a file and a directory: import java.io.File; class Directory{ public static void main(String[] args){ String directory=”/exampledirectroy”;//example directory name File file1=new File(directory);//instantiating file class with […]

Categories

Specially Chosen for you

Tag Cloud

RSS Site Feed

Want to buy? Choose Amazon!


Meta

Classifieds