One thing we need to know about in Korean is called stroke order. This term comes from the times when Korean was written with a brush. It was customary to make the brushstrokes for each letter in a specific order.
It's much the same in English; when you print a capital N, you draw the lines in this standard way.
You could get the same result with this stroke order:
but we seriously doubt your grade school teacher would have approved, and it just wouldn't feel right.
The next page uses Java to show you the stroke order for the Korean letters. The general rule is that characters are written from top to bottom, left to right.