controlling anagram words
<p>here is my code. but it doesnt work. please help me about where is my problem. it is very complicated for me. my code must find that my 2 inputs are anagram or not. (ex: silent and listen)</p>

<pre><code>    import java.util.Scanner ;
    import java.lang.String ;
    public class Anagram {

public static void main(String[] args) {
    Scanner scanner = new Scanner (System.in) ;

    System.out.println("Enter your firs word: ");
    String s1= scanner.nextLine() ;
    System.out.println("Enter your second word: ");
    String s2 = scanner.nextLine() ;

    if(isAnagram(s1,s2)){

        System.out.println("Your words are anagram") ;

  }
}

public static boolean isAnagram(String s1, String s2) {

   int a = s1.length() ;
   int b= s2.length() ;
    if (a==b){
        int count=0;
        int i,j ;
        char x, y ;
        for (i=0, j=0; i&lt;=a; i++){

         x = s1.charAt(i) ;

        y = s2.charAt(j);

        j++;
        if (x==y){
            count++ ;
      while (count==a){
          return true;
      }
                    return false;
        }
    }  
    }

}    
</code></pre>

<p>}</p>
