I have generate a User class which include the first name and the last name. I wan to ask how can i generate different random name with using random generator?
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
public class User {
private String firstName;
private String lastName;
private int age;
/**
* @return the firstName
*/
public String getFirstName() {
return firstName;
}
/**
* @param firstName the firstName to set
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* @return the lastName
*/
public String getLastName() {
return lastName;
}
/**
* @param lastName the lastName to set
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* @return the age
*/
public int getAge() {
return age;
}
/**
* @param age the age to set
*/
public void setAge(int age) {
this.age = age;
}
}
Can anyone show me some snippet code on how to deal with this generator?? Please teach me. Thank you.
Aucun commentaire:
Enregistrer un commentaire