-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathUser.java
More file actions
58 lines (40 loc) · 1.11 KB
/
User.java
File metadata and controls
58 lines (40 loc) · 1.11 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import java.util.Scanner;
public class User {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
System.out.println("enter your password");
String password= input.nextLine();
System.out.println(" " + setPassword(password));
System.out.println("your password is "+ password);
System.out.println("enter your email");
String email= input.nextLine();
System.out.println(setEmail(email));
System.out.println("enteremail is " + email);
}
private String email;
private int Password;
public static String setPassword(String password) {
if(password.length()<=6) {
System.out.println("your password don't have 6 caracters or more");
}else if (password.length()>=10) {
System.out.println("your password have more than 10 caracters");
}
return password;
}
public int getPassword()
{
return Password;
}
public static String setEmail(String email)
{
if(email.endsWith(".com")) {
System.out.println(" not good email");
}
return email;
}
public String getEmail()
{
return email;
}
}