Consider the following code:
m_Writer = new PrintWriter(new FileWriter(\"LoginHistory.dat\"));
m_Writer.println(Integer.toString(s_NumOfLogins));
m_Writer
It seems plain that you don't have permission to create that file where you're trying to create it, hence the "Access denied" message. You'd need to find a directory where you're allowed to create files. If you're not sure where a file is going to be created, you can see its full path with File.getAbsolutePath() or File.getCanonicalPath().