小编Tai*_*kun的帖子

Java使用UTF-8读取和写入文件到文件

我正在创建一个类似日语字典的程序,所以我需要将日文单词对象存储在一个文件中.我目前正在尝试创建一个无线编码的dat文件,但我一直在获取FileNotFound Exceptions.我的主要目标是能够将我自定义创建的单词对象存储在一个文件中,该文件可以存储和读取包含日文文本和值数组的对象.所以如果你知道无论如何要解决这个问题,我将非常感激!

这是我的试用课来测试它:

  public class JavaApplication1 {

/**
 * @param args the command line arguments
 */
Scanner scan = new Scanner(System.in);
//File file = new File("test.dat");
public static void main(String[] args) throws FileNotFoundException, IOException,    ClassNotFoundException {
    // TODO code application logic here
    JavaApplication1 ja = new JavaApplication1();
    ja.start();
}
public void start() throws FileNotFoundException, IOException, ClassNotFoundException{

    System.out.println("Enter Kanji");
    String Kanji = scan.next();
    System.out.println("Enter Romanji");
    String Romanji = scan.next();
    System.out.println("How common is it");
    int common = scan.nextInt();
    System.out.println("How many types of …
Run Code Online (Sandbox Code Playgroud)

java filenotfoundexception

1
推荐指数
1
解决办法
1209
查看次数

标签 统计

filenotfoundexception ×1

java ×1