Commit 52734f86 authored by rawan's avatar rawan

step2

parent 631f771f
package hacker;
public class AscendingHackerThread {
public class AscendingHackerThread extends Thread{
private Vault vault;
public static final int Max_PASSWORD = 9999;
public AscendingHackerThread(Vault vault){
this.vault =vault;
//A function that changes the name of the thread only to make it easier to track it while running
this.setName(this.getClass().getSimpleName());
}
public void run(){
for (int x=0;x<=Max_PASSWORD;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