BarneyInTechno
Junior Member
hi, i gota stupid problem that i dont see why i have. This is the prob. i am passin in an array of objects through my main of a class Algorithm, and than it takes it in, sets the value to another array, than i use it later on, i do this by :
public Algorithm( Object [] x, int size, int max )
{
vertex = new Object[size];
for ( int i = 0; i < size; i++ ) // Moves over info from x to vertex
{
vertex = new Object();
vertex = x;
}
}
and than i try to use this array of objects, but its giving me the compile time error
"Method getDistance() not found in class java.langObject."
Just to clarify, i made an array of objects in my Main to the class Vertices, than i pass it through to the Algorithm class and make an array called "vertex" use it like this...
if ( predecessor[j] == end )
{
if ( type.equals("D"😉 )
c = vertex[v].getDistance();
else
c = vertex[v].getTime();
}
but than it gives me that error whenever i call the method getDistance(). Help PLESAE!!
public Algorithm( Object [] x, int size, int max )
{
vertex = new Object[size];
for ( int i = 0; i < size; i++ ) // Moves over info from x to vertex
{
vertex = new Object();
vertex = x;
}
}
and than i try to use this array of objects, but its giving me the compile time error
"Method getDistance() not found in class java.langObject."
Just to clarify, i made an array of objects in my Main to the class Vertices, than i pass it through to the Algorithm class and make an array called "vertex" use it like this...
if ( predecessor[j] == end )
{
if ( type.equals("D"😉 )
c = vertex[v].getDistance();
else
c = vertex[v].getTime();
}
but than it gives me that error whenever i call the method getDistance(). Help PLESAE!!