Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6981207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:07:35+00:00 2026-05-27T18:07:35+00:00

I have created 3 arraylists and stored data in it. I need to pass

  • 0

I have created 3 arraylists and stored data in it. I need to pass one single arraydata to other page and so I have added my individual arrays to the main array. But when I added one array to other the data is not being aded to that array. Here is my code:

static ArrayList<ArrayList<String>> stringList1=new ArrayList<ArrayList<String>>();
static ArrayList<ArrayList<String>> stringList3; 

stringList1 = Mypage.stringList1;

 ArrayList<String> optionlist = new ArrayList<String>();
stringList3 = new ArrayList<ArrayList<String>>();stringList3 = dbAdapter.selectRecordsFromDBList(query2, null); 
 for (int i = 0; i < stringList3.size(); i++) {
    optionlist = stringList3.get(i);
    System.out.print("option list size");
    System.out.print(optionlist.size());
    stringList1.add(optionlist);
    System.out.println("total stringlist1"+stringList1.get(0));

I am getting the stringList1 array values from Mypage and accessing that in new page. In the new page I am trying to add the optionlist array to stringList1 by giving stringList1.add(optionlist) but the data is not adding. Where I went wrong? Please help me regarding this… Thanks in Advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:07:36+00:00Added an answer on May 27, 2026 at 6:07 pm

    After seeing your code I can guess that you have problem that elements of arrayList is not copy in another arrayList.If this is your issue then change your code like below

    static ArrayList<ArrayList<String>> stringList1=new ArrayList<ArrayList<String>>();
    static ArrayList<ArrayList<String>> stringList3; 
    
    stringList1 = Mypage.stringList1;
    
    ArrayList<String> optionlist;
    stringList3 = new ArrayList<ArrayList<String>>();
    stringList3 = dbAdapter.selectRecordsFromDBList(query2, null); 
    
     for (int i = 0; i < stringList3.size(); i++) {
        optionlist = new ArrayList<String>();
        optionlist = stringList3.get(i);
        System.out.print("option list size");
        System.out.print(optionlist.size());
        stringList1.add(optionlist);
        System.out.println("total stringlist1"+stringList1.get(0));
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have created one fully xml based project. my doubts now I store
Have created a c++ implementation of the Hough transform for detecting lines in images.
I have created a template for Visual Studio 2008 and it currently shows up
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a PHP-script to update a web server that is live inside
I have created a UserControl that has a ListView in it. The ListView is
I have created a C# class file by using a XSD-file as an input.
I have created a few small flash widgets that stream .mp3 audio from an
i have created a workflow activity that do give the item creater of a
I have created a class call ImageLoader and use memory cache to store all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.