There are two types:
Electricity is scarce on a boat. You can use it when you have connection to land and will not have hot water while cruising. Running a generator might be an option.
Gas is dangerious and will require a flue.
You can have hot water if you have tank heater. this will keep the water hot even after you use land power. Another opportunity is to heat water when your engine is running.