Sunday, 15 July 2012

I have created a method, but Java doesn't see it - Java -


I have been learning programming from TheNewBoston for a while and writing the file in 80th tutorial. I followed my code word for the word, but Eclipse says that the method is unscheduled for the method "creatfile", I have checked more than I have seen, but I do not see the problem. Here's the code.

creatfile.java

  import java.util.Formatter; Public class creatfile {personal formatter x; Public Zero OpenFile () {try {x = new format ("chinese.txt"); } Hold (exception e) {System.out.println ("you have an error"); } There is an error on public Zero addRecords () {// "Zero" and "addRecords" x.format ("% s% s% s", "20", "Yakub", "Peterson"); } Public Zero Closed File () {// Error here x.close (); }}}  

apple.java (my main square)

  import java.util. *; Public category apple {public static zero main (string [] args) {creatfile g = new creatfile () {g.openFile (); G.addRecords (); G.closeFile (); }}}}}  

Your main method is not understood . Try it:

  public class apple {public static zero main (string [] args) {creatfile g = new creatfile (); G.openFile (); G.addRecords (); G.closeFile (); }}  

No comments:

Post a Comment