Attachment 'Files.java'
Download 1 package fondamenti.files;
2
3 import java.io.File;
4
5
6
7 public class Files {
8
9 public static void main(String[] args) {
10
11 //Sostituire con un percorso valido sul proprio pc
12 File f = new File("/Users/ricca/Desktop");
13
14 if(f.exists())
15 System.out.println("esiste");
16
17 if(f.isDirectory())
18 {
19 for(String s : f.list())
20 {
21 System.out.println(s);
22 }
23 }
24 }
25
26 }
Attached Files
You are not allowed to attach a file to this page.