Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming usage

hashCode and equals

The Empire strikes back

Report a typo

The Resistance is organizing ships to confront the Empire. R2D2 has a list with all the ships. The Resistance will attack only if all the ships have the same ammunition. Please complete the ship definition to help R2D2.

Sample Input 1:

Ford-11 Bismarck-20 Titanic-34 HMS-44

Sample Output 1:

false
Write a program in Kotlin
// complete the definition of the ship
class Ship(val name: String, val ammunition: Int) {

}
___

Create a free account to access the full topic