Is it better coding practice to pre-compute and save the length of an array before looping through the object? Similarly, what about for strings?
//Given int Array A, that won't change size
for (int i = 0; i < A.length; i++)
System.out.println(A[i]);
vs
int Asize = A.length;
for (int i = 0; i < Asize; i++)
System.out.println(A[i]);
-- similarly for strings
//Given string s, that won't change size
for (int i = 0; i < s.length(); i++)
System.out.println(s.charAt(i));
vs
//Given string s, that won't change size
int sSize = s.length();
for (int i = 0; i < sSize; i++)
System.out.println(s.charAt(i));