How does the given Java code generate all permutations of a string

visit shbcf.ru