Difference between Files#delete(Path) and File#delete()

后端 未结 2 683
情深已故
情深已故 2020-12-01 18:00

I\'m using Windows-7 with java 7 update 6 and found this weird (at least to me) behavior -
I have two files E:\\delete1.txt and E:\\delete2.txt

2条回答
  •  时光说笑
    2020-12-01 18:40

    Why different behavior for same operation with old and new nio API?

    Because exactly emulating the behaviour of the old API for similar operations was apparently not considered an important goal in the design of the new API. Given that the main goal of the nio filesystem API was to present a new API with some quite different underlying concepts and a lot of new capabilities, it seems pretty normal to me.

提交回复
热议问题