Sunday, July 29, 2012

Creating a file in Java

Until now, the posts I wrote were on setting up development environment but for the first time I am gonna write something about coding. It's a simple tutorial on how to create files in Java. It's nothing fancy but just a point for me to start and take you into a bit of programming. So let's get started.

There are many times when you need a file during development may be to write some data (could be a txt or csv or your own format). It's very simple to create a file. You simply need to use the File class from the Java IO. It has many methods and one of them is File.createNewFile().