The Java.io method is to perform disk operations on the files on the disk

Source: Internet
Author: User

File Class (java.io.*) can represent a file, or it may be a directory (in Java, files and directories belong to this class, and the distinction is not very obvious).

The method under Java.io is to perform disk operations on the files on the disk, but the contents of the file cannot be read.

Note: Creating a File object and creating a file in Java is two different concepts. The former creates a file in the virtual machine, but does not actually create it to the OS's file system, and as the virtual machine shuts down, the created object disappears. Creating a file is really a file created in the system.

1 Package tomtexts;2Import java.util.*;3  Public classtomtexts_24 {4      Public Static voidMain (string[] args) {5Stack stack1=NewStack ();//constructs an empty stack stack16         Try {7Stack1.push (NewInteger (0));8Stack1.push (NewInteger (1));9Stack1.push (NewInteger (2));TenStack1.push (NewInteger (3)); OneStack1.push (NewInteger (4)); ASystem. out. println ((Integer) Stack1.pop ()); -System. out. println ((Integer) Stack1.pop ()); -System. out. println ((Integer) Stack1.pop ()); theSystem. out. println ((Integer) Stack1.pop ()); -System. out. println ((Integer) Stack1.pop ()); -         } -         Catch(Emptystackexception e) {} +                -     } +  A}

The Java.io method is to perform disk operations on the files on the disk

Related Article

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.