Both of them are good options, none is better than the other.
1. With Blogging you can always share you knowledge and experience regarding the concepts that you know. You don't have to wait for the right question in forums like Stack Overflow to share your knowledge.
2. You should also contribute to forums like Stack Overflow as there might be certain questions where you can provide answers/more clarification. Remember how such forums are helping us with our coding life :) ..... and in situations where none or only 1 or 2 answers/hints are present for a problem, we wish there be some more contributors/developers.
So these are both great options for you to share/increase your knowledge and you should go for both of them.