Commit 631f771f authored by rawan's avatar rawan

step1

parent ee6da106
package hacker; package hacker;
public class DescendingHackerThread { public class DescendingHackerThread extends Thread {
private Vault vault;
public static final int MAX_PASSWORD = 9999;
public DescendingHackerThread(Vault vault) {
this.vault = vault;
this.setName(this.getClass().getSimpleName());
}
public void run() {
for (int x = MAX_PASSWORD; x >= 0; x--) {
if (vault.isCorrectPassword(x)) {
System.out.println("success " + this.getName() + "the correct password " + x);
System.exit(0);
}
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment