⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 file9.java

📁 学习java编程的好程序
💻 JAVA
字号:
import java.io.*;
///创建一个文件类对象f
///创建一个文件输出流对象fos,并且以f作为参数
///创建一个多字节输出流对象dos,并且以fos作为参数
///使用dos对象将数据写入到f中
public class file9
{
    public static void main(String[] args)throws Exception 
    {
        String st;
        File f=new File("d:\\1.dat");
        FileOutputStream fos=new FileOutputStream(f);
        DataOutputStream dos=new DataOutputStream(fos);
        try
        {
        dos.writeUTF("明天要下雨了。");
        dos.writeUTF("明天要下雨了。");
        dos.writeUTF("明天要下雨了。");
        dos.writeUTF("明天要下雨了。");
        }
        catch(Exception e)
        {}
        dos.close();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -