When you are looking at your pictures in playback mode, you can turn on the highlight function to check your exposure. What this will do is take the part of the picture that is too bright and has lost all detail and blink it on and off to highlight it. If a large portion of the image is highlighted in this way, you have overexposed the picture, or the contrast in the frame is far too high.
To turn on the highlights, press down twice in playback mode. The first press will take you to the histogram, and the second to the highlight.
To turn off the highlights in the Nikon D40, press up twice to go back to the normal playback mode.