![]() |
|
Welcome to the UndergroundScene Forums forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Senior Member
Join Date: Feb 2003
Location: Dundee
Posts: 2,537
![]() |
Java programming
Does anyone know how to embed an arraylist with another arraylist? I've thought abt the idea of creating the arraylists in different classes then importing from 1 class into another but this doesnt seem right to me anyone got any suggestions?
|
|
|
|
|
|
#2 (permalink) | |
|
Senior Member
Join Date: Apr 2002
Location: Dundee/Alyth hybrid
Posts: 1,501 Band: 15 Minutes
![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
ArrayLists are similar Linked Lists in C++. Each List elemen is an object. if you want to set an ArrayList element to be another ArrayList it can be done but is a bad model. it would be bertter to have each Arraylist element containing a container object. See below for a rough example You could have an 'ArrayList ' of customer order stored in object 'custOrders' each 'custOrders' item could be an 'orderItems' object. OrderItems could either extend ArrayList or encapsulate an Array list depending on functionality required. it's hard to suggest a solution as I don;t really know what the problem is Post an example of what you're trying to do and I'll see if i can help |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|