You didn't ask me, but...
Class G is a linear amplifier (like Class-AB) but allows the output stage to run at two or more power supply voltage levels. Choosing a low voltage for low signal levels improves the efficiency of the amplifier beyond the theoretical best case of 50% for Class-AB.
And if you look at it this way, Class-AB also chooses between two power supplies -- positive and negative -- or between two phases of the output transformer primary in the case of tube amps. Making the switching "transparent" to the user, so it doesn't create an audible artifact is one of the fine arts of amp design. The term for the artifact is "crossover distortion."
Class D is a "switching" amplifier, that varies the output voltage by varying the duty cycle of a high frequency signal.
So they're actually quite different from one another.