Java is not my main programming language so I might be asking the obvious.

But is there a simple file-handling library in Java, like in python?

For example I just want to say:

File f = Open('file.txt', 'w')
for(String line:f){
      //do something with the line from file
}

Thanks!

UPDATE: Well, the stackoverflow auto-accepted a weird answer. It has to do with bounty that I placed - so if you want to see other answers, just scroll down!

Edit
Report