Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/02/2012, 08:18
alexg88
 
Fecha de Ingreso: abril-2011
Mensajes: 1.342
Antigüedad: 13 años
Puntos: 344
Respuesta: recibir array de objeto a metodo duda

Primero, no se escribe otrosPuntos[], sino otrosPuntos.

Segundo, length es un atributo del array, no un método, se le llama sin paréntesis

Código Java:
Ver original
  1. public Punto calcularMasCercano(Punto[] otrosPuntos) {
  2. for(int i=0;i<otrosPuntos.length;i++){
  3. // otrosPuntos[i] = ...
  4. }
  5.  
  6. }