|
java學(xué)習(xí)一定不能放下,順便學(xué)習(xí).net(當然是工作需要)。不過可以好好比較一下現(xiàn)在比較主流的2種編程環(huán)境!~~
加油吧。。。。。。。
Java程序有兩類注釋:實現(xiàn)注釋(implementation comments)和文檔注釋(document comments)。實現(xiàn)注釋是那些在C++中見過的,使用/*...*/和//界定的注釋。文檔注釋(被稱為"doc comments")是Java獨有的,并由/**...*/界定。文檔注釋可以通過javadoc工具轉(zhuǎn)換成HTML文件。
詳細介紹文檔注釋的頁面
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.IOException;
public class Result {
private File result =new File("result.txt");
private FileWriter writer;
private PrintWriter pw;
public Result() {
try {
writer = new FileWriter("result.txt");
pw=new PrintWriter(writer);
}
catch (IOException iox){
System.err.println(iox);
}
}
public void aLine(String in) { //寫入一行
pw.println(in);
}
public void finish() { //關(guān)閉輸入流,將文字從緩存寫入文件
try{
pw.flush();
writer.close();
}catch (IOException iox){
System.err.println(iox);
}
}
}
終于開始學(xué)習(xí)Struts了,好容易有點時間,不過馬上又要到北京出差不得不停下來。我將把我的學(xué)習(xí)情況,每天學(xué)到的知識發(fā)在Bo Java學(xué)習(xí)筆記里。