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

  • Home
  • SEARCH
  • 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 7608185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:51:10+00:00 2026-05-31T00:51:10+00:00

i want to store Arraylist inside Another List, some thing like this i know

  • 0

i want to store Arraylist inside Another List, some thing like this i know its wrong but pretty much like this….

 List list=new ArrayList();
 list.add(new("element1","element2","element3",element4=?);
 list.add(new("element5","element6","element7",element8=?);

now if u see the above code its ok and fine to add elements or first row to list up to third element but the fourth element is another array[string array] how to add it or append it to the first row of element.
same with the second row.

NOTE:- element4 and element8 are also differ in length means element4 has 2 string and element 8 has 10 strings.

when i display the list it should show list like this

  The first row of list is
  element1  element2  element3  element4.1  element4.2 
  the second row of list is
  element5  element6  element7  element8.1  element8.2 element8.3 element8.4 element8.5 element8.6 element8.7 element8.9 element8.10
  • 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-31T00:51:11+00:00Added an answer on May 31, 2026 at 12:51 am

    Have you tried following way:

        List list = new ArrayList();
        list.add(Arrays.asList("element1", "element2", "element3",
                Arrays.asList("element4.1", "element4.2")));
        list.add(Arrays.asList("element5", "element6", "element7",
                Arrays.asList("element8.1", "element8.2", "element8.3")));
    
        // print values
        System.out.println(list.get(0));
        System.out.println(list.get(1));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to store a couple of sockets in an ArrayList/NSMutableArray, but the sockets
I want to store buttons in some sort of collection, arraylist, so that I
I have some data stored as ArrayList . And when I want to backup
I want to store a large number of sound files in a database, but
I want to store a list of the following tuples in a compressed format
I want to store the Arraylist values into database(postgresql database) in java. ArrayList<String> ActiveProcess
I want to store few strings into an array using ArrayList. How can I
How can I retrieve one activity arraylist into another activity and store,update and clear?
I'm struggling a bit with this. I want to get the list of ids
I want to store a regular array in My.Settings. Not an ArrayList, not a

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.