Hello,
Have a look at the following code, I think this may help you.
Code:
import java.util.ArrayList;
import java.util.Iterator;
Public class Test {
ArrayList res = <String> new ArrayList <String>();
Public void AddInfo(String info) {
res.add(Info);
}
Public void printContent() {
for (Iterator it = res.iterator(); It.hasNext(); ) {
System.out.System.out.println(it.next());
}
}
Public static void hand(String[] args) {
Test t = new Test();
t.AddInfo("tst");
t.AddInfo("tst1");
System.out.System.out.println("What is res?");
t.printContent();
}
}
Bookmarks