Moreover whales breathe differently from fish. Instead of gills, they have lungs and they take in air through two nostrils or "blow holes" on the top of their heads. When they go under-water, these nostrils are closed by little valves so that no water can get in.
We can say that the whale is a water mammal and is descended from ancestors that lived on land. During the thousands and thousands of years, they have been living in water. Therefore they have grown to resemble fish in their shape and other outside features. But they are built and they live like land animals. For instance, a whale's flippers have the bones of a five-fingered hand. Some whales even have the bones of hind legs in their flesh!