的迭代我有一個A類爪哇 - 的ArrayList
CLASS A
public ClassA {
ArrayList<ClassB> objB= new ArrayList<ClassB>();
//getter and setter of objB
}
CLASS B
public classB {
int x;
int y;
private List<ClassC> objC= null;
//getter and setter of x,y and objC
}
C類
public classC {
int a;
int b;
//getters and setters of a,b
}
我將結果集存儲在類A中的objB中。我試圖在我的服務類中迭代objB。
公共類serviceImpl {
ClassA的objA =新ClassA的();
//這裏我需要得到變量X,Y,的A,B
}
你的問題並沒有多大意義。請更清楚地說明你想要什麼... –
顯示你的代碼而不是描述它。 –
[在方法中迭代ArrayList]的可能的重複(http://stackoverflow.com/questions/5236112/iterating-arraylist-inside-a-method) –