Java File class

Source: Internet
Author: User
Application of files

The input and output of Java is implemented in the form of data flow, and the creation of the data stream requires the file object.

Java file Creation (1) The full name of the file consists of a directory path and a file name. C:\java\bin\client\java.exe, the full name of the. exe file the path to the C:\java\bin\client file, also called the Directory (2) in Java directory is treated as a special file, uniform use of file class for directory and file (3) in Java for the operation of the stream class in the Ava.io.* package file class

(1) The file class is an abstract representation of the path names of files and directories.

(2) The file class does not specify how the information is read from the file or stored to the file, which describes the properties of the files themselves. (3) The file object is used to obtain or process information related to disk files, such as permissions, time, dates, and directory paths. How to construct the file class

You can use a path to construct a file object in the above constructed method, or you can construct a file object from the file's parent path and filename.

Method for file class to access the properties of files

How to manipulate files with the file class

Java File class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.