Learning Java IO knowledge summary

1, File class using:

  · Constructor: public File (String path), File.sepatator representing the separator;

  · Determine whether a file exists: public boolean exitsts ();

  · Get ​​parent path: public File getParentFile ();

  • Create Directory: public void mkdirs ();

  · Delete files: public void deltete ();

2, file copy program: InputStream, OutputStream operation;

3, the output data using print program stream (PrintStream, PrintWriter), the input data using the Scanner (provided with a separator problem, if the file set delimiter trouble, it is replaced with BufferedReader Scanner);

4, the target sequence: class implements java.io.Serializable interface.

Reproduced in: https: //www.cnblogs.com/kvikon/p/4689321.html

Guess you like

Origin blog.csdn.net/weixin_33863087/article/details/94701571