This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Then there would have been an error message that tells you what went wrong; tell us what that was. Also tell us what command you used to compile the code. (If you're still using an IDE, make sure you understand where that IDE would put compiled class files, and check whether that's where they are.)
And just to make sure: You have checked that the class file didn't end up in a different subdirectory than you expected, right? Packages are involved, after all.
I did it in command prompt.
compilation error in command line is::
cannot fine symbol
symbol: method flush()
And in IDE the error message is::
flush() is undefined for type CSVWriter
Joined: Mar 22, 2005
I just tried, and found that the following code compiles fine. It's the same you're using, minus any stuff that deals with classes that are not present; maybe you can work your way from there towards your code, and that way find out where the problem originates.