Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.File;

public class Main {
    public static void main(String[] args) {

        // returns pathnames for files and directory
        File[] paths = File.listRoots();

        // for each pathname in pathname array
        for (File path : paths) {
            // prints file and directory paths
            System.out.println(path);
        }

    }
}