Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between java.nio.file.Files and java.io.File? [closed]

Tags:

java

file-io

nio

What are the advantages or key features of Files over File ? When to prefer one & why ?

Edit: This is just another 'difference between' question in our world - so be sure that you REALLY want to downvote it!

like image 683
Raúl Avatar asked Apr 20 '15 11:04

Raúl


1 Answers

As per Java Docs, java.nio.file.Files class consists exclusively of static methods that operate on files, directories, or other types of files. In most cases, the methods defined here will delegate to the associated file system provider to perform the file operations.

Whereas java.io.File is an abstract representation of file and directory pathnames.

like image 146
Vimal Bera Avatar answered Nov 22 '22 19:11

Vimal Bera