Commit ee6da106 authored by rawan's avatar rawan

step1

parent 4f7842d8
package hacker;
import java.util.Random;
public class Vault {
private int password;
private int password; // Private so it cannot be accessed from outside the class
public Vault(){
Random random = new Random();
this.password = random.nextInt(10000);
//Print the correct password in the terminal in order to ensure as a user that the codes are correct.
System.out.println(" the correct password:"+this.password);
}
public boolean isCorrectPassword(int x){
try{
Thread.sleep(5);
}catch (InterruptedException e){
//If an interrupt occurs, we print the error
e.printStackTrace();
}
return x == this.password;
......
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