Access the value from list in java -
this 1 of class
class number11 { string ab; int i; public number11(string ab,int i) { this.ab=ab; this.i=i; } } and in main method, used
list<number11> n1= new arraylist<number11>(); how can access value of integers , string contained in list? wish print them use further.
just loop on list:
for (number11 n : list) { string ab = n.ab; int = n.i; //print ab , } note number11 should in camelcase follow java's conventions: number11.
Comments
Post a Comment