• Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling a final private main

 
John James
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm considering certification and have looked at a few mock exams. Could someone explain why the following code compiles(jdk1.3) and runs.
import java.io.*;
public class FileTester{
final private static void main(String[]args){
try{
File fi=new File("DATAbase");
FileWriter buf=new FileWriter(fi);
PrintWriter pw=new PrintWriter(buf);
pw.println("Hello2");
pw.flush();
}
catch(IOException ioe){};
}
}
Cheers
John
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!