added missing toString javadoc for ships
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user