import java.util.ArrayList;
import java.util.List;
public class ObjectTest {
public static void main(String[] args) {
String[] id = new String[8];
String[] type = new String[8];
String[] username = new String[8];
List userlist = getUsers(type, id, username);
}
private static List getUsers(String[] type, String[] id, String[] username) {
List list = new ArrayList();
for (int i = 0; i < type.length; i++) {
list.add(new User(type[i], id[i], username[i]));
}
return list;
}
}
class User {
public User(String tpye, String id, String username) {
this.tpye = tpye;
this.id = id;
this.username = username;
}
private String tpye;
private String id;
private String username;
public String getTpye() {
return this.tpye;
}
public String getId() {
return this.id;
}
public String getUsername() {
return this.username;
}
public void setTpye(String tpye) {
this.tpye = tpye;
}
public void setId(String id) {
this.id = id;
}
public void setUsername(String username) {
this.username = username;
}
}