title: to find the intersection of two multisets in java
body: <pre><code>         for(i=0;i&lt;m1.length();i++)
               for(j=0;j&lt;m2.length();j++)
                   if(m1.charAt(i)==m2.charAt(j)){
                       intersection=intersection+m1.charAt(i); 
                       m2.charAt(j)=' ';
  
  
  
                   }
  
                      System.out.println(intersection);
  
  
  
           } while(devam==false);
  
      }
  
  }
  </code></pre>
  
  <p>that's my code. and we are <strong>not allowed to use a method or an array</strong>, we are just beginners.my code gives an error at the point of  <code>m2.charAt(j)=' ';</code>. i wrote that line because, when we find an intersection, we shouldn't check that element again.can you please help? </p>