Java中BufferedWriter類的常用方法

2021-08-20 05:19:26 字數 549 閱讀 7279

bufferedwriter:字元緩衝輸出流

bufferedwriter(writer out) :

預設緩衝區大小構造字元緩衝輸出流物件

bufferedwriter(writer out,int size):

指定緩衝區大小

public void write(int c) throws ioexception

寫入單個字元。

c - 指定要寫入字元的 int。

public void write(string str) throws ioexception

寫入字串。

str - 要寫入的字串

public void close() throws ioexception

關閉此流,但要先重新整理它。

public void newline() throws ioexception

寫入乙個行分隔符。

public static void main(string args) throws exception

Java中equalsIgnoreCase的用法

equalsignorecase public boolean equalsignorecase string anotherstring 將此 string 與另乙個 string 進行比較,不考慮大小寫。如果兩個字串的長度相等,並且兩個字串中的相應字元都相等 忽略大小寫 則認為這兩個字串是相等的...

Java筆記 Java 中 this 用法小結

據我所知,this有三個用途,但this都表示當前物件自身。一 訪問當前物件的資料域 public class testthis public testthis int age 當構造方法傳入的變數的變數名和當前物件資料域中的變數名一樣時,可以使用 this 來訪問當前物件資料域的變數。二 呼叫當前...

java中物件導向好處 Java中 介面作用

使用物件導向思想進行開發有以下優點 1 易維護 採用物件導向思想設計的結構,可讀性高,由於繼承的存在,即使改變需求,那麼維護也只是在區域性模組,所以維護起來是非常方便和較低成本的。2 質量高 在設計時,可重用現有的,在以前的專案的領域中已被測試過的類使系統滿足業務需求並具有較高的質量。3 效率高 在...