Sunday, 10 December 2017

How to write Java program to get a list of all file/directory names from the given

Learning Java Programming Made Easy


Here is an example program to get the list of all file/directory names from the given link...

Please try this by your self and learn..



import java.io.File; import java.util.Date; public class Exercise1 { public static void main(String a[]) { File file = new File("/home/students/"); String[] fileList = file.list(); for(String name:fileList){ System.out.println(name); } } }

No comments:

Post a Comment

Welcome, happy learning

Charactor_At_Position

public class Char_At_Position { public static void main(String[] args) { String str = "Wankhede"; String rev=""...