ArrayList Retrieve object by Id

后端 未结 7 532
别跟我提以往
别跟我提以往 2020-12-16 12:49

Suppose I have an ArrayList of my custom Objects which is very simple. For example:

class Account
{
public String Name;
public In         


        
7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-16 13:13

    You must use the Map for example:

    private Map AccountMap;
    for (String account : accounts )
                 AccountMap.put(account, numberofid);
    

提交回复
热议问题