Yes there can be a difference. The spec allows the compiler to automatically optimize this but doesn't require it to. Running a
test using Sun 1.5, iterating over 1000000 strings, results in the following:
for (int i = 0; i < rules.length; i++) 1861516 nanos
int len = rules.length;
for (int i = 0; i < len; i++) 1619266 nanos
About a 10% difference, which depending on what you're doing, may or may not be significant.
It's more important to do this kind of optimization when method calls are involved, like with a Collection. Doing the same test but putting the 1000000 strings into an ArrayList and using size(), results in:
for (int i = 0; i < list.size(); i++) 9949896 nanos
int len = list.size();
for (int i = 0; i < len; i++) 1615477 nanos
Over an 80% difference.