2

Java has both the File class and the Path interface file operations. I've seen instances of the newer one, Path, act in many cases as a replacement for the traditional File class. Obviously, it is trivial to move between the two with Path.getFile() and File.getPath().

Are there situations where one is preferable over the other? Which of the two should I use for general cases, such as passing information to a method? Is one faster or safer than the other? Other than the interface, are there any major differences or significant limitations to one or the other?

gobernador
  • 5,659
  • 3
  • 32
  • 51
  • Check this out to see if it helps out: http://docs.oracle.com/javase/tutorial/essential/io/legacy.html – AngelTrs Jul 08 '15 at 21:44

0 Answers0