I saw this question on stackoverflow yesterday while browsing through the java tag.
The instant I saw the title and the content, I thought that it was yet another one of those questions in which the OP just dump his homework and expect us to do it.
But on looking at it more carefully, I saw that the OP wanted to clarify a doubt on his/her homework. The OP did not seem to understand the homework question. But unfortunately, the OP was at once greeted with harsh downvotes, negative comments and close-votes as if the OP's question was the type of "Gimme teh codez" question.
So my question is, Aren't questions which ask for clarification of a homework question on-topic for StackOverflow?