Yes, of course you can; from the help center:

https://stackoverflow.com/help/self-answer

And the most famous example of this:

https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it

Just make sure both the question *and* answer are up to the quality standards of SO and you'll be fine. "How do I debug my code in < insert IDE >" could easily make a good canonical question (though it smells a bit broad).