No la entiendes porque no se ha explicado.
En Java (y en otros lenguajes como C, C++ y C#) hay un operador que se llama ternario:
(condicion) ? valor_si_verdadero : valor_si_falso;
Es una especie de if/else comprimido.
Si se cumple la condición, se ejecuta valor_si_verdadero; en caso contrario, se ejecuta valor_si_falso.
Espero que te ayude.
I don't like that you don't have to create classes here. I know the title of the page says "Practice creating objects" but in the individual tasks it says "Create the Person class." but the class is already written. In the previous lessons one had to re-type a whole program just for practice. I think it's easy enough as of now to write the class as well. The average number of attempts for this task is 1.18 and it reflects that it's too easy :).
If you have trouble with Implement the fight method, check how your code handles these additional cases:
1) If both cats have exactly same values.
2) If cat1 has 2 better values and 1 worse than cat2.
3) If cat1 has 1 better value and 2 worse than cat2.
GO TO FULL VERSION