public class Driver {
public static void main(String[] args) {
int length=0;
int MaxNumber=100;
StringBuilder password = new StringBuilder();
do {
if (PasswordGenerator.matchLength (length))
System.out.println("The length of the character is " + length);
length++;
} while (length < MaxNumber);
do {
if (PasswordGenerator.matchCharAt (password))
System.out.println("The password is " + password);
} while ( );
}
}
My code is supposed to find the length of a given password, which it already does. And then the next step is supposed to determine the password, by appending each individual character with Stringbuilder.
But anyways I keep getting an error that
method matchCharAt in class PasswordGenerator cannot be applied to given types:
Required: char, int
Found: StringBuilder
Reason: Actual and formal argument lists differ in length*
Any help would be awesome!
P.S. Password Generator is a “Made up” class, if you need documentation I can post it.
The error code says clearly, you are using wrong parameter:
You need to provide two parameter: First one
char, second aintThis question sounds and smells like homework. If so: Please tag it as homework.