title: Swapping a specific character in a char array with another character java
body: <p>it has been 8 years since I last programmed, and then it was just basics for a networking degree. I am writing a basic program to start my way back into java programming. the program is dealing with binary numbers stored as strings. </p>
  
  <p>e.g. <code>01101110010</code></p>
  
  <p>I have got everything else working, but now I want to swap all "1" for "0" and all "0" for "1"</p>
  
  <p>to get <code>10010001101</code></p>
  
  <p>The problem is the only way I know to swap chars is to create a new string with the chars replaced but I can only do one char at a time and then I just end up with a string of all <code>1</code>s or <code>0</code>s</p>
  
  <p>so I thought about using a char array and trying to swap each char in the array but I have no idea how to go about this. </p>