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.*