Program to check whether two strings are anagrams of each other
About the algorithm (ITS NOT CORRECT). I will still review it for you:


Passing l1 and l2 in boolean check(char[] c1,char[] c2,int l1,int l2) as argument is redundant. You can use the inherent c1.length and c2.length provided by Java.
if(count==l1 &amp;&amp; count==l2) Any one check would do as you overruled l1!=l2 very early. Remember?
Failure cases:
"aab" and "abb" both would be called anagrams. Hope you discover that.


About the algorithm:


There are simpler better ways to check if two strings are anagram. How? Sort the strings and compare character by character.
Not impressed? Do a character count using a Map for each character and compare it for other array. And there are many more. Happy Googling.