Friday, 25th June 2010
The new frontier for learning Java

Talk:FileIterator.java

From WikiJava

Jump to: navigation, search

Comments on FileIterator.java

Title (required):

Website:

Comment:


choice

what happens if one enters a char 'N' for no or 'Y' for yes. could u prints directories names alone.otherwise well done. Regards Machot, Sudan

--66.178.108.182 11:31, 28 November 2008 (UTC)


normalizing the example

I think there are several things to change in this example:

  1. I don't like the fact it's interactive, it would be way better if there was an option at command line.
  2. the interactivity is even not used, to answer to 66.178.108.182 this program doesn't seem to consider the 'Y' or 'N' at all, just type anything to avoid the exception
  3. the exception is thrown upon an user input, it's pretty common that the user would make a mistake there so it would be better to consider such a case in an if statement, rather than in a try catch.

I quickly updated the example formatting the lines. it's important not to write lines longer than 80 characters. To do so I simply copy pasted the code in eclipse and pressed CTRL + F (format code).

--DonGiulio 12:49, 28 November 2008 (UTC)