class A
if(userAuthenticated)
ArrayList accounts = getAccountForUser(customerId);
UserInfo userinfo = new UserInfo();
userinfo.getUserInfo(accounts);
}
==============
class UserInfo
{
public ArrayList<String> getUserInfo(ArrayList list) {
ArrayList useraccounts = list;
return useraccounts;
}
}
===============
現在C類裏面我將有一個字符串,我需要檢查,如果當時該字符串值存在做別的事情做soemthingJava的:我需要做的方法不同的表現爲不同的請求
的問題是因爲這是一個Web應用程序,我不能在應用程序中使用實例varaibe。
class C
{
public String makeDBCALL(String account)
{
Here i need to get that ArrayList of UserInfo and check if taht list.contains(account))
could anybody please tell me how can do this .
}
}
必須說您的問題有點含糊。有時候明確你所擁有的東西是有用的,更好地瞭解如何從中獲得解決方案。無論如何謝謝你試圖隔離問題:) – helios