This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes reference to array element Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "reference to array element" Watch "reference to array element" New topic

reference to array element

ernest mcdermott

Joined: Mar 05, 2007
Posts: 28
hi everyone,
iv currently got a minimal spanning tree style piece of code. I currently have a start vertex and an edge away. Next i want to retrieve the name of the next vertex that this edge leads to.

Currently i have the following code:

n is an array of vertice names
ce[i] is the chosen edge

i want the value for i, say that it represents element 3 in the array, i want this to then choose element 3 in the array of vertice names as this is the next vertice that it leads to.
im sorry if the question seems a little unclear, this is the best way i could think to propose it.
Thanks in advance
ernest mcdermott

Joined: Mar 05, 2007
Posts: 28
hi all, ok iv now got it going the right direction, but the problem is that it outputs the word null as oposed to the vertex name. Can any1 suggest what might be wrong.
Thanks in advance.
It is sorta covered in the JavaRanch Style Guide.
subject: reference to array element
Similar Threads
cannot find symbol
July Newsletter Puzzle (Maze Solver)
Exception in thread "main" java.lang.NullPointerException
"Position" Concept as it applies to Data Structures
ignore after an iteration in a while loop