JAVA API Learning Record a java.lang.*

Source: Internet
Author: User

Interface appendable
Appendappendable Append (charsequence csq) throws Java.io.IOException appends the specified sequence of characters to this appendable. Sometimes the entire sequence may not be appended, depending on which class is used to implement the character sequence csq. For example, if CSQ is an instance of Charbuffer, the sub-sequence to append is defined by the position and restriction of the buffer. Parameter: CSQ-sequence of strings to append. If CSQ is null, the appendable is appended with a four-character "null". Return: This appendable reference is thrown: java.io.IOException-if I/O occurs Error--------------------------------------------------------------------------------appendappendable Append ( Charsequence csq,int Start,int end) throws Java.io.IOException appends the subsequence of the specified character sequence to this appendable. When CSQ is not NULL, calling this method in the form of Out.append (CSQ, start, end) is identical to the behavior of calling this method in the following form: Out.append (start, end) parameter: csq.subsequence- The sequence of characters that the subsequence will be appended to. If CSQ is null, the four-character "null" is appended as if the CSQ contains the characters. Start-the index of the first character in the subsequence end-the index of the character immediately following the last character in the subsequence is returned: The reference to this appendable is thrown: indexoutofboundsexception-if start or end is negative, and start is large At end or end greater than csq.length () java.io.IOException-if I/O occurs Error--------------------------------------------------------------------------------appendappendable append (char c ) throws java.io.IOException to this appendableAppends the specified character. Parameter: C-the character to append is returned: The reference to this appendable is thrown:

Java.io.IOException-If an I/O error occurs

Interface autocloseablevoid Close () throws exceptionthrows:exception-if This resource cannot be closedImplementing automatic shutdown of resources

 Packagecc.OpenHome; Public class Main {         Public Static voidMain(String[]args) {        Try(ResourceRes= New Resource()) {Res.Dosome();        } Catch(Exceptionex) {ex.Printstacktrace();        }    }}class Resource Implements autocloseable {    voidDosome() {        System. out.println("do something.");    }    @Override     Public voidClose() throws Exception {        System. out.println("Resource is freed");    }}



JAVA API Learning Record a java.lang.*

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.