how to use an array list ?
        Posted  
        
            by soad El-hayek
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by soad El-hayek
        
        
        
        Published on 2010-04-23T08:34:35Z
        Indexed on 
            2010/04/23
            8:43 UTC
        
        
        Read the original article
        Hit count: 357
        
salam 3lekom
i need to know if i store my data in an Araaylist and i need to get the value that i've stroed in it
for example : if i've an array list like this
      ArrayList A = new ArrayList();
      A = {"Soad", "mahran"};
and i want to get each String lonly how can i do it ?
I've tried to do it like this
package arraylist;
import java.util.ArrayList;
public class Main {
        public static void main(String[] args) {
        ArrayList S = new ArrayList();
        String A = "soad ";
        S.add(A);
        S.add("A");
        String F = S.toString();
        System.out.println(F);
        String [] W = F.split(",");
        for(int i=0 ; i<W.length ; i++) {
           System.out.println(W[i]);
        }
    }
}
© Stack Overflow or respective owner