Which is better in terms of performance for iterating an array?
(a) for(int i=0; i<100; i++)
(b) for(int i=99; i>=0; i–)
(c) for(int i=100; i<0; i++)
(d) for(int i=99; i>0; i++)
I had been asked this question in a job interview.
Origin of the question is Coding best practices topic in section Autoboxing & Miscellaneous of Java