I need to create a recrusive function to generate a random string - When setting the recrusive as following - the char value - starting from a is not increased - What am i doing wrong?
private static String findPasswordTest2(Password p, int length, String testString, char a)
{
if (p.isPassword(testString))
{
return testString;
}
if (a!='z')
{
findPasswordTest2(p, length, testString, a++);
findPasswordTest2(p, length, testString+a, a++);
}
findPasswordTest2(p, length, testString+a, a);
if (p.isPassword(testString))
{
return testString;
}
return "error";
}