A
Alamannianus
Until now the class is sweet and dandy. Now I want to implement a
function, so that when the user fills in his emailaddress and password,
the system generates a unique id for this user. How can I implement
such a function? Please help.
######################################
public class user {
private String email; //user fills in his email
private String passwort; //user choses a password
private String id; // HERE AN ID SHOULD BE GENERATED BY THE
SYSTEM
public user(String emailAddress, String Userpassword) {
email = emailAddress;
passwort = Userpassword;
}
public void releasedateindtabase () {
System.out.println(("User with ID: " + id ));
System.out.println(("and email Address " + email));
System.out.println(("is registered in the system"));
}
}
###########################################################
// this "superclass" is the one where all users are stored
import java.util.ArrayList;
public class Database {
private Arraylist user;
public Database() {
user = new Arraylist();
}
public void getuser(user theuser) {
user.add(theuser);
}
}
function, so that when the user fills in his emailaddress and password,
the system generates a unique id for this user. How can I implement
such a function? Please help.
######################################
public class user {
private String email; //user fills in his email
private String passwort; //user choses a password
private String id; // HERE AN ID SHOULD BE GENERATED BY THE
SYSTEM
public user(String emailAddress, String Userpassword) {
email = emailAddress;
passwort = Userpassword;
}
public void releasedateindtabase () {
System.out.println(("User with ID: " + id ));
System.out.println(("and email Address " + email));
System.out.println(("is registered in the system"));
}
}
###########################################################
// this "superclass" is the one where all users are stored
import java.util.ArrayList;
public class Database {
private Arraylist user;
public Database() {
user = new Arraylist();
}
public void getuser(user theuser) {
user.add(theuser);
}
}