###You can ask about basic programming in Stack Overflow
It's perfectly fine to ask about basic conceptual issues in programming, about how to structure your code and all sorts of code issues.
##This question got downvoted because it was poorly researched and written
Questions like "What does the method foo
do" for a very comon foo
are bad because:
###There is no real problem being solved or specific enough issue.
In this case OP could find out what it does by doing System.out.println(word)
. Had the question been "How do I get the next token from a scanner?" or "How do I print the first character in a string?" assuming those are not dupes - it would have been better accepted.
###Any research would have helped OP
While I'm not a Java fan it's hard to deny it has excellent documentation. Googling "Java Scanner Next API documentation" would have easily landed OP a good help page. Had the question being about a more obscure API it would have been better accepted. The fact it's such a common API that has good documentation matters.
To illustrate:
- The duplicate of OP's problem has 4 upvotes.
- A similar question about the same problem has 27 upvotes.
- An actual specific question about the same API has 4 upvotes.
So it's really all about writing a well researched specific question.