Internet °ü·Ã ÀÚ·á |
---|
Á¦¸ñ | Hello World - Java Source 1998/04/24 (14:31) |
À̸§ | ±èÈ¿¿ø |
¹øÈ£ | 3 |
Á¶È¸ | 400 |
º»¹® |
import java.io.*; class HelloWorld { public static void main(String args[]) { try{ RandomAccessFile file=new RandomAccessFile("my.txt","rw"); StringBuffer line=new StringBuffer(); line.setLength(0); String str="All my words!"; line.append(str); line.append("\r\n"); file.writeBytes(line.toString()); file.close(); } catch (IOException e){ System.out.println("Error"); } } } |