java List<User> users ; instance; zuo yong ?
publicenumUserDAO{instance;List<User>users;privateUserDAO(){users=newArrayList<User>(...
public enum UserDAO {
instance;
List<User> users ;
private UserDAO() {
users = new ArrayList<User>(3);
User user1 = new User("Paul", "Athlone");
users.add(user1);
User user2 = new User("John", "Tullamore");
users.add(user2);
User user3 = new User("David", "Roscommon");
users.add(user3);
}
public List<User> list() {
return users;
}} 展开
instance;
List<User> users ;
private UserDAO() {
users = new ArrayList<User>(3);
User user1 = new User("Paul", "Athlone");
users.add(user1);
User user2 = new User("John", "Tullamore");
users.add(user2);
User user3 = new User("David", "Roscommon");
users.add(user3);
}
public List<User> list() {
return users;
}} 展开
2015-10-06
展开全部
程序是你的,你才知道需求、知道逻辑的了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询