Oysters

Oysters are pretty interesting, as it is known that their reproductive cycle is pretty wild. Young males release sperm into the water while older females release eggs, which can result in sometimes millions of new mollusks. Yet they are also one of the most notable animals that can gender-switch, simply because they have to do so biologically.
Every oyster starts their life as a male, but most will change to female after around a year or two and usually do so permanently. The reproductive system for oysters produces both sperm and eggs, so it is possible for them to fertilize their own eggs but rarely do. Yet this is why only young males put sperm in the water for eggs to fertilize with. They’ll become a female after a few years, so they need to give females their sperm before they switch.