Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Java (https://www.askmehelpdesk.com/forumdisplay.php?f=440)
-   -   Convert arraylist to an array of arraylist! (https://www.askmehelpdesk.com/showthread.php?t=652486)

  • Apr 19, 2012, 04:12 PM
    BeWahtEver
    convert arraylist to an array of arraylist!
    I do have an ArrayList and I want to convert it to an array of arrayList.

    I have a class X that has an ArrayList. And In the main class , I have an ArrayList that has many X objects. I want to create a new Array of ArrayList Y[ ] that has the element of the ArrayList from X in my ArrayList. How can I do this? Here is my code...
    class X {
    ArrayList<Double> data;

    X() {
    data = new ArrayList<Double>();
    }

    public class C{
    ArrayList<X> XX = new ArrayList<X>();

    ArrayList Y[]=null;
    // Now I want to convert XX to Y[ ]

    }

  • All times are GMT -7. The time now is 12:10 AM.