I notice some people seem to differ when comparing two strings together, such as when comparing a variable to a constant. For example, let's say we have a constant string and an input method:
public final String CONSTANT_STRING = "A constant string";
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Is it better or faster in any way to use the unknown input first:
br.readLine().equals(CONSTANT_STRING)
or to compare the constant to the unknown:
CONSTANT_STRING.equals(br.readLine());