| Author |
Code review required for converting dateformat
|
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
No it's not. At least not quite. There is (at least) one flaw in your code: i will never be equal to array.length inside the loop. You should check against array.length - 1.
And I would move the check against empty input to before the loop. Sure, your loop will end after the first iteration, but it still looks odd.
I also see you ignored my advice on using the other parse method to prevent having to catch parse exceptions.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: Code review required for converting dateformat
|
|
|