The answer to 'difference between gas water heater and electric water heater' is that gas water heaters use natural gas or propane to heat the water, while electric water heaters use electricity. Gas water heaters tend to heat water faster and have lower operating costs, but require a gas line and proper ventilation. Electric water heaters are simpler to install, don't require a gas line, and are generally safer, but have higher energy costs.
The choice between a gas or electric water heater often comes down to the availability of gas service, upfront installation costs, and ongoing energy costs in your local area. Both types can be reliable and efficient, so the best option depends on your home's setup and your personal preferences.