Major scales have the following sequence of whole and half steps:

We can build a major scale starting on any note as long as we keep the same sequence of whole and half steps. Below, we create another major scale starting on D, which is called the D major scale:

Why do we write accidentals at the beginning of the staff? These accidentals are called key signatures. In the previous and following examples, the key signature using F and C sharp implies that every F and C should be played as a sharp. See Key Signatures for more information.
Beethoven used this scale to compose the Ode to Joy in the final movement of his Ninth Symphony: