private static void saveCallers(String fName, RadioShow r) throws IOException {
//TODO write the code to save the callers to a file
try
{
FileOutputStream outStream = new FileOutputStream("C:\\Desktop\\text1.txt");
ObjectOutputStream out = new ObjectOutputStream(outStream);
out.writeObject(r);
out.close();
}
catch(Exception e)
{
System.out.println("something went wrong here! : " + e);
}
}
它给了我一个URLClassLoaderException,所以我假设我给它一个不正确的格式?但我似乎无法弄清楚这样做的正确方法。
谢谢
答案 0 :(得分:0)
确保" C:\ Desktop \"文件夹存在。