This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "access array" Watch "access array" New topic
Author

access array

Castulo Ruiz
Greenhorn

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
Sheriff

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

Joined: Jun 15, 2010
Posts: 232

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


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

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.
A.row[0].displayForward();
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: access array