Question: I have a couple of methods which take filenames as parameters. My doubt is that what is better way to declare the parameters of these methods. 

* Should the parameter be of type `String`

```
void normalizeData(String inFile)

```
* Or should I explicitly declare the parameter as `File`.

```
void normalizeData(File inFile)

```

Personally I find `File` more intuitive but want to know about what is the best practice for such things.

Answer: 
Think about using multiple overloaded methods to give the user of the API the choose.

Also think about passing an `InputStream` as it is possible that the user of the API wants to use any in memory representation of the data.
It depends whether you want the file hanlde outside the normalizeData method or inside it only. If you want to do something on file prior or after calling your normalizeData method then create a file object outside normalizeData method and pass the reference to the method. If ONLY your normalizeData method need to work on the file object then simply pass the filename to it.

Depends on your need and how you want to handle your file.