我创建了一个account抽象类,它是另外 3 个不同帐户类的超类。
然后在一个manageAccount类中我必须创建一个存储帐户类的 ArrayList。在这个类中,我有一个方法应该找到特定类型的类,例如,它返回EspecialAccount数组列表中的每个类。我的 arrayList 是类型Account,我不知道如何添加继承它的类。是否可以?
public class ManageAccounts {
ArrayList<Account> aList = new ArrayList();
public String SearchSpecialAccounts(){
for(int i=0; i<aLista.size(); i++){
//how can I search in the arrayList all of the specialAccounts?
}
}
我是JAVA初学者,请多多指教。
拉丁的传说
森林海
沧海一幻觉
慕的地8271018
相关分类