title: In java, how do I check if a string contains only 1 or 0
body: <p>Also, how would I prompt the user to try again until they enter something with only 1 or 0 in it?</p>
  
  <p>I realize I must use a for, or a while loop, but I'm not sure what to put as the condition.</p>
  
  <p>I'm trying to have it so the user is prompted to enter something in binary, and if they don't enter something in binary, to be asked again to enter something in binary, and repeated until they do. </p>
  
  <p>Thanks in advance!</p>