Page 1 of 1

About Question enthuware.ocpjp.v7.2.1583 :

Posted: Sun Sep 29, 2013 10:16 pm
by lucas91
Hi, Paul!
I want to ask, why

Code: Select all

File[] roots =File.listRoots();
for(File f:roots){

System.out.println(f);
}
is wrong? I tested both this and the right answer :

Code: Select all

Iterable<Path>proots = FileSystems.getDefault().getRootDirectories();
for(Path p:proots){
System.out.println(p);
}
and both ended printing the same result.

Re: About Question enthuware.ocpjp.v7.2.1583 :

Posted: Mon Sep 30, 2013 7:49 am
by admin
You are right. This option should be marked correct as well. Fixed.

thank you for your feedback!
Paul.