|
|
@ -0,0 +1,42 @@ |
|
|
|
public class SignUp { |
|
|
|
private String name; |
|
|
|
private String password; |
|
|
|
|
|
|
|
// Constructor |
|
|
|
public SignUp(String name, String password) { |
|
|
|
this.name = name; |
|
|
|
this.password = password; |
|
|
|
} |
|
|
|
|
|
|
|
// Getters and Setters |
|
|
|
public String getName() { |
|
|
|
return name; |
|
|
|
} |
|
|
|
|
|
|
|
public void setName(String name) { |
|
|
|
this.name = name; |
|
|
|
} |
|
|
|
|
|
|
|
public String getPassword() { |
|
|
|
return password; |
|
|
|
} |
|
|
|
|
|
|
|
public void setPassword(String password) { |
|
|
|
this.password = password; |
|
|
|
} |
|
|
|
|
|
|
|
// Function to create user |
|
|
|
public static SignUp createUser(String name, String password) { |
|
|
|
// add validation logic here |
|
|
|
return new SignUp(name, password); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
// Example |
|
|
|
SignUp user = createUser("JohnDoe", "password123"); |
|
|
|
|
|
|
|
// Example of accessing properties |
|
|
|
System.out.println("User Name: " + user.getName()); |
|
|
|
System.out.println("User Password: " + user.getPassword()); |
|
|
|
} |
|
|
|
} |