Browse Source

Simple signup function with username and password

remotes/origin/feature/client/make-input-field-buttons-interactive
Richard Schmidt 11 months ago
parent
commit
ad0ef73647
  1. 42
      src/main/java/SignUp.java

42
src/main/java/SignUp.java

@ -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());
}
}
Loading…
Cancel
Save