我的 PrintWriter 属性文件有一个小问题。这是主文件的代码:
package org.goverment;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Tg {
public static final void main(String[] args) throws Exception {
cout("The Goverment - Create your own country!/");
cout("Press the number associated with your choice then press enter./");
cout("1. New Game/");
cout("2. Continue/");
cout("3. ExitGame/");
int c = Integer.parseInt(cin());
if(c == 1) {
cout("/");
cout("Country name: ");
String name = cin();
cout("\nIs this a soviet country? (y/n): ");
String soviet = cin();
boolean svt;
if(soviet.equalsIgnoreCase("y") || soviet.equalsIgnoreCase("yes"))
svt = true;
else if(soviet.equalsIgnoreCase("n") || soviet.equalsIgnoreCase("no"))
svt = false;
else
svt = false;
Game.setup(Game.cc(), name, svt);
} else if(c == 2)
System.exit(0); // Game.c();
else if(c == 3)
System.exit(0);
}
private static String cin() throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
return br.readLine();
}
public static final void cout(String s) {
if(s.endsWith("/") || s.equalsIgnoreCase("")) {
System.out.println(s.substring(0, s.length() - 1));
} else {
System.out.print(s);
}
}
}
这是游戏类: http: //pastebin.com/bktg6nSc
这就是问题所在:文件 isint 创建...我不断刷新和关闭,但没有任何反应。我一直在查看应用程序数据,但那里没有 thegoverment.properties。
所以我该怎么做?我真的需要帮助,这是一个学校项目,我必须在 2 天内完成。