title: How can I compare two strings in java and define which of them is smaller than the other alphabetically?
body: <p>I want to use the binary search algorithm to search the string which has been entered by the user in a very big sorted file. I can not compare the string which has been entered by the user with the string which has been located in the middle line of the file to continue my binary search.</p>
  
  <p>For example, if the user's string is <code>abcda</code> and the file's string is <code>abcza</code>, it is obvious that the user's string is smaller than the file's string. How is it implemented in java? it will be great if you can help me with a sample code.</p>