Possible Duplicate:
Causes of 'java.lang.NoSuchMethodError: main Exception in thread “main”'』メイン」
私は、テキストファイルのbyte配列を記述しようとしています。私が使用していたコードが
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
public class writefile {
//it works well
public static void main()throws IOException{
Writer output = null;
byte[] a= {1,2,3,4,5,6};
try {
String text = "abcd...\n";
String str3 = text.concat("the end");
String NL = System.getProperty("line.separator");
str3 = str3.concat(NL);
str3= str3.concat("next line");
for (int i=0; i < a.length; i++){
str3 = str3.concat(NL);
str3= str3.concat(" " +a[i]);
}
File file = new File("write.txt");
output = new BufferedWriter(new FileWriter(file));
output.write(str3);
System.out.println("Your file has been written");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (output != null) {
output.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
親切に助けて下のようになり、スレッド内のメイン 例外 "メイン"
:
java.lang.NoSuchMethodErrorの:私にエラーを与えていますどうすれば問題を解決できますか?
プログラムの実行方法を教えてください。 –