title: Java equivalent of Python dictionary
body: <p>Is there a cleaner way for doing this ? </p>
  
  <pre><code>public void change(char x)
  {
      if(x == 'a')
      {
         return 'b';
      }
      else if(x == 'b')
      {
         return 'a';
      }
      else if(x == 't')
      {
         return 'r';
      }
      else if(x == 'r')
      {
         return 't';
      }
      return 'z';
  }
  </code></pre>
  
  <p>I was wondering if there was anything built into Java so that I can swap pairs of characters like a dictionary in Python or is this the best way to do this?</p>