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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -