|
pehal lak jadi gini... hambek ko.. homework.. paham kan tulisan aku atas ni
alasan malas nak ubah balik |
|
|
|
|
|
|
|
java -cp . MyClass > result
selalu orag guna cara manual ni..
kalau yang auto, kene buat method
FileOutputStream <-- saerch la.. aku pun tak pernah guna |
|
|
|
|
|
|
|
Reply #24 kmkd's post
oo ni kene buat otomatik...ok thanx 4 da guide..
nnt try cari |
|
|
|
|
|
|
|
Balas #25 carsein\ catat
kalau tahu tu ajar la sini.. aku pun nak tahu gak |
|
|
|
|
|
|
|
Balas #27 carsein\ catat
tak la.. mana ada aku tipu.. aku ambik dari java api tu..
masalah nya aku tak pernah guna.. so aku suh ko cari..
pastu ajar aku |
|
|
|
|
|
|
|
Hm tak berjaya r..
tak tau camne nak call output tu ke File..
Setakat nak tulis kat console n then write to file to reti la |
|
|
|
|
|
|
|
ops sori...lambat reply..dah jadi dah
aku guna FileWriter jek...ok ni code die
public class WriteFile
{
private String m_filename = "";
private BufferedWriter m_out = null;
public WriteFile(String fileName){
m_filename = fileName;
}
public void openFile() throws IOException{
try{
//Create file
FileWriter fstream = new FileWriter(m_filename,true);
m_out = new BufferedWriter(fstream);
}catch(IOException){
System.err.println("Error: " + e.getMessage());
throw e;
}
}
public void closeFile() throws IOException{
try{
m_out.flush();
m_out.close();
}catch(IOException){
System.err.println("Error: " + e.getMessage());
throw e;
}m_out = null;
}
public void writeToFile(String text) throws IOException{
try{
m_out.write(text);
}catch(IOException){
System.err.println("Error: " + e.getMessage());
throw e;
}
}
} |
|
|
|
|
|
|
|
Ni soalan ni mayb mudah untuk korang..tp for newbie cam aku...
camne nak panggil value bagi variable dari void method dari lain2 class ek..
kena guna setter and getter ker?? |
|
|
|
|
|
|
|
Reply #33 kmkd's post
thanx
kalo ade pape aku post lagi kat cni.. |
|
|
|
|
|
|
|
Salam...
Aku nk mintak tlg...
Dlm Coding java biasa, Boleh ke kite link kn button tu ke page yg lain??
Or yg function tu dlm JSP sajer???
Thanks in advance |
|
|
|
|
|
|
|
Balas #35 ctmufizano\ catat
button ke page lain?
maksud?
kalau swing.... ko kene ada interface lain la rasanya kot |
|
|
|
|
|
|
|
Reply #35 ctmufizano's post
tak berapa clear la soalan..
linkkan button ke page lain? |
|
|
|
|
|
|
|
Balas #37 carsein\ catat
entah.. maybe maksud dia.. dia buat satu interface lepas tu nak ke interface lain kot.. |
|
|
|
|
|
|
|
Originally posted by kmkd at 3-4-2009 09:28
entah.. maybe maksud dia.. dia buat satu interface lepas tu nak ke interface lain kot..
ha... lebih kurang macam tu la????
Kire mcm link dr interface ke interface lain..
p/s:- sorry sbb x soklan x clear |
|
|
|
|
|
|
| |
|