📄 j_example.java
字号:
// ////////////////////////////////////////////////////////
//
// J_Example.java
//
// ////////////////////////////////////////////////////////
import java.io.*;
public class J_Example
{
public static void main(String args[])
{
try
{
RandomAccessFile f =new RandomAccessFile("test.txt","rw");
int i;
double d;
for (i= 0; i< 10; i++)
f.writeDouble(Math.PI*i);
f.seek(16);
f.writeDouble(0);
f.seek(0);
for (i= 0; i< 10; i++)
{
d=f.readDouble( );
System.out.println("["+i+"]: "+d);
}
f.close( );
}
catch (IOException io)
{
System.out.println(io);
System.exit(-1);
}// End of try-catch structure.
} // End of method: main
} // End of class: J_Example
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -