D-Type NIKKOR Lenses
....
A D-type lens relays subject-to-camera-distance information to Nikon D-SLRs that feature 3D Color Matrix Metering (all versions), 3D Matrix Metering, 3D Multi-Sensor Balanced Fill-Flash and i-TTL Balanced Fill-Flash. Many D-Type lenses have an aperture control ring and can be used on older Nikon SLR cameras that allow for manual control of the aperture, as well as on D-SLRs—especially useful for adjusting aperture while recording D-Movies on higher end models. When used on a D-SLR, the aperture control ring needs to be locked at the smallest possible aperture (generally designated in orange), and the aperture control is maintained through the camera's command dial.
G-Type NIKKOR Lenses
....
A G-type lens does not have an aperture control ring and are intended for use on Nikon D-SLRs that allow the lens aperture to be adjusted via the camera's command dial. Because G-type lenses relay subject-to-camera-distance information to the camera, where it is used to help determine ambient and flash exposure, they are also considered to be D-type lenses. The lack of an aperture control ring is perhaps the easiest way that you can tell if a lens is a G-Type NIKKOR or not.
....