[問題] 存檔問題, 給我選又不給我用= =

看板java作者 (魔)時間19年前 (2007/01/20 12:50), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
我是一個java的初學者 現在正在寫一個類似小畫家的東西 在處理存檔問題的時候碰到了一個我不知道問題在哪裡的問題 在以下的兩行裡 painterSave psave = new painterSave(); psave.Save("D:\\test.txt", point, shapes, colors); ^^^^^ 第二個save的地方會給我標紅線 可是我在另外一個class裡面的確有Save這個public void 而且當我打完psave按下.的時候 我用的Jbuilder的下拉式選單還有那個選項給我按 我另外一個叫painterSave的class在下面 我目前的目的是先在D槽上存一個空白的txt檔 這個成功後我才打算把我的point, shapes, colors 做成string然後放到txt檔裡 問題可能很笨 請見諒 import java.io.*; import java.awt.Point; public class painterSave { public painterSave() { } public void Save(String filename, painterFrame point[], painterFrame shapes[], painterFrame colors[]) { File file1 = new File( filename ); try { FileOutputStream fout = new FileOutputStream(file1); this.Save( fout, point, shapes, colors); } catch (IOException ex) {} } /* end of procedure variation_manager::Save */ public void Save(FileOutputStream fout, painterFrame point[], painterFrame shapes[], painterFrame colors[]) { try { int tcount = point.length +1; String st; String total = ""; for (int i = 0; i < tcount; ++i) { fout.write(total.getBytes()); } } catch (IOException ex) { System.err.print(ex.toString()); }//end of try } } -- 當你把你丹田內的空氣加壓到5個大氣壓 從你嘴裡噴出的氣流就可以達到1500m/s 相當於5倍音速 而這......就是嘴炮的奧義 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.70.99.125
文章代碼(AID): #15iP-8Es (java)
文章代碼(AID): #15iP-8Es (java)