It's definitely a great thing to answer your own question, as mentioned in the faqmentioned in the faq. This is more about etiquette: if I ask a question and think I know the answer, should I post it immediately?
Some people think you should post immediately, like this meta.stackoverflow.com answer says (though it was written before any sites beyond the original trilogy even existed), then let voting encourage or discourage the effort.
Others think it's polite to wait, in order to encourage other answers and not be perceived as rep-farming. (Note from the author: rep-farming is a nasty word, sorry - obviously producing content in order to get rep is part of the system.)
Which is it? Does it depend on the question (or answer)?