Justin Charpenter wrote:I have been also getting an error
"Errors exist in reuired project(s)"
There is nothing like being specific, and that error message is nothing like being specific. Have you any idea what it means?
Where is that sun.security package from? My javac tool couldn't find it. It can be hazardous to use classes starting with "sun." because some of them are experimental and might be removed from later releases of
Java. But if you search for something, Eclipse has a habit of finding the most obscure types first, so that type might be there by mistake.
You appear to be closing your Counter (probably shouldn't have capital "C") in the loop. That may cause your problems about closed stream. You will need to close it in a finally. So . . .
wrap opening the Counter stream in a try-catch for FileNotFoundException.That would be similar to what I showed yesterday about opening your reading stream.Close your writing stream in a finallyAt first I thought you can reuse the finally you close the reading stream in, but that would read
So I thought, this chap has got too much going on in one method. You ought to have a reading method, a calculation method and a writing method.
You are using some old-fashioned code, choosing DecimalFormat when you could create the String with % tags using the
String#format() method instead.
There is nothing wrong with the finally block. Maybe you have Eclipse set in real fusspot mode, which is useful, but you may need to take the warnings with a pinch of salt.
You have managed to declare MAYFILE (which name ought not to be in upper-case) twice. You have
BufferedReader MAYFILE twice; on the second occasion
you should simply write
MAYFILE without "
BufferedReader". Eclipse is trying to be helpful by suggesting renaming as an option.
If you are a beginner, you would probably do well to stop using IDEs (eg NetBeans, Eclipse) until you have more experience. IDEs can be more of a hindrance than a help to beginners. Have a look at
this recent thread about text editors.