added missing toString javadoc for ships

This commit is contained in:
2025-04-15 22:16:37 -05:00
parent 6fccf0cc20
commit e14806c444
2 changed files with 8 additions and 0 deletions

View File

@@ -26,6 +26,10 @@ public class CargoShip extends Ship {
return maxTonnage;
}
/**
* Returns string representation of Cargo Ship object, including name and max cargo tonnage
* @return String representation of object
*/
@Override
public String toString() {
return "Cargo Ship " + name + ". Max Tonnage: " + maxTonnage;

View File

@@ -30,6 +30,10 @@ public class CruiseShip extends Ship {
return maxPassengers;
}
/**
* Returns string representation of the Cruise Ship object, printing the name and max passengers
* @return String representation of object
*/
@Override
public String toString() {
return "Cruise Ship " + name + ". Max passengers: " + maxPassengers;