December 14, 2017 a Java-developed Python road----------------(ii)

Source: Internet
Author: User

Say one of the biggest harvests is this. Close the Stream object

Before writing Java read the file, the end often to close the stream object, I have not understood, why, I do not use the. Close () method, the file can also be read successfully, the total sense of no meaning

It turns out that this. Close () method is not for Java files, or Python files, because the operation of the file object is done by the operating system.

This open, read, and close are all telling the operating system to execute, as for this close () is to tell the operating system that my files are finished and can reclaim resources.

Of course, you do not write off, to read and write have no effect, but the possibility of resources open, can not be closed, over time will affect the efficiency of the program

There is also the concept of Python and a tuple is not in Java, the first time I heard the word, I thought it was Ganso cake ~ ~ ~

The function of tuples is to store values, tuples can store a value or multiple values, and the value can be any type

There is also a character encoding, because all Unicode encoding, read files are used in this format, so in the memory, also follow this code, will not be wrong, but once again using UTF-8 encoding ~

December 14, 2017 a Java-developed Python road----------------(ii)

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.