File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes access array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "access array" Watch "access array" New topic

access array

Castulo Ruiz

Joined: May 08, 2009
Posts: 12
Not sure how to access an array of linked list.

I have an ADT of linked list and I have created an array of linked list.
The problem I have is that when i call a funtion getLength

well this is how I access it.

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46320
You would have to provide more details of where the array is.
Thakur Sachin Singh
Ranch Hand

Joined: Jun 15, 2010
Posts: 238

give some more details...your requirement is not clear.

SCJP 6- 91%, IBM DB2, IBM RAD Certified
Castulo Ruiz

Joined: May 08, 2009
Posts: 12
the array is an Object array that holds a linked list.
The linked list holds objects as well.

an ADT of a linked list has been created for this project.

In the end the array is nothing more than an array of List.

the list will represent a matrix.

to create a matrix:
// this will create a nxn matrix.
Matrix A = new Matrix(2);

now I have to to able to change the contents of the list.
In order to able to to this I must first access the matrix then the array and finally the linked list.

inside Matrix() the following is being done:
// an array of list.
List row[]= new List[n];
then just code on creating the matrix

so the main problem is when i create a new matrix 'A' I am not sure how to access what is inside.
can it be like something like this?
// diplayForward prints out the linkedlist.
I agree. Here's the link:
subject: access array
It's not a secret anymore!