The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

RE: Drives on your machine

Posted by Kishori Sharan on October 13, 2000 at 11:44 AM

Hi
Compile and run the folowing Test.java file to get the list of drives you have on your machine.

Thanx
Kishori

///////////////Test.java
import java.io.* ;

class Test {

public static void main(String[] args) throws Exception {
File f[] = File.listRoots ( ) ;

for ( int i = 0 ; i < f.length ; i++ ) {
System.out.println ( f[i] ) ;
}
}

}





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us