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

📄 ex.java~15~

📁 这是我最得意的一件小作品。它是一个基于C/S模式的网络考试系统
💻 JAVA~15~
字号:
package testsystem;
import java.io.*;
import java.util.*;
public class EX
{
    public static void main(String arsg[])
    {
        try {
            System.out.println("创建文件输入流对象。。。");
            FileInputStream fs=new FileInputStream("E:\\input.txt");
            byte data[]=new byte[200];
            System.out.println("读入文件数据到指定组数中。。。");
            fs.read(data);
            String str=new String(data);
            System.out.println(str);
            Date date=new Date();
            System.out.println(date.toString());
            System.out.println(date);
            System.out.println("创建文件输出对象。。。");
            FileOutputStream fos=new FileOutputStream("E:\\output.txt");
            System.out.println("将指定数组中的内容读入到文件中。。。");
            fos.write(str.getBytes());

            System.out.println("关闭所有文件");
            fs.close();
            fos.close();
        } catch (Exception ex) {

        }
    }
}

⌨️ 快捷键说明

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