0
I’m doing a program that applies hill climbing, but the value I need to compare to see if the previous one is better than the next one is a vector double
My method to find the best value returns an array double
:
public double[] método(parâmetros){
código
return vetor;
}
What I’m not able to do is assign this vector to another vector:
public void método2(parâmetros){
double vet2[] = new double[n];
vet2[]=método(parâmetros);
}
My question is how I could return the vector and pass its values to another vector in another method?
If the best value is only 1 why return a double vector? And it would just be
vet2 = método(parâmetros);
– Isac
Thank you, that’s right.
– Magno
Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site (when you have enough score).
– Maniero