If you are wondering how the question came to have an answer, you can see from the question's timeline that the answer was posted before the question was closed.
Preventing answers being posted is indeed the primary effect of closing a question. We close questions (except for duplicates) because they are not answerable within the scope of the site, that is, they cannot receive an answer that belongs here. The idea is, if answers are posted to questions that are off topic, too broad, unclear, or primarily opinion based, then that increases the quantity of unsuitable content (and also makes it less likely that the question will be deleted or migrated). If duplicate questions receive answers, information that ought to be kept together gets spread out and probably harder to find.