-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPassword.java
More file actions
33 lines (26 loc) · 779 Bytes
/
Password.java
File metadata and controls
33 lines (26 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* Aditya Bhatia
10/08/2019
Password*/
import java.io.*;
public class Password {
public static void main(String[] args){
String password = "";
String corrPass = "";
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try
{
System.out.println("Enter the password to set: ");
corrPass = br.readLine();
corrPass = corrPass.trim();
while (password.equals(corrPass) == false)
{
System.out.println("Enter your password: ");
password = br.readLine().trim();
}
System.out.println("Access granted!");
}
catch (IOException e)
{
}
}
}