Returns:
the number of elements in the path, or 0 if this path only represents a root component
...全文
33413打赏收藏
新手发现java7 API的一个bug??
import java.nio.file.*; class Test { public static void main(String[] args) { Path p=Paths.get("."); System.out.println(p.getNameCount()); } } 如果你把“.”换成当前路径,再运行一遍发现结果不一致。 应该不是bug,但JAVA究竟是如何处理和看待这个“.”东东的?? API Specifications follow below: int getName