Forums Login/signup

Tell The Details

+Pie Number of slices to send: Send
The more information you provide, the easier it is for people to answer your questions. Consider these examples:


  • [not helpful] My program throws an error.
  • [better] My program throws a NullPointerException on line 13. Below is the code and the stack trace.


  • The better one provides the reader with everything he/she needs to know to answer your question. Helpful information, if applicable, includes:

  • Detailed description of problem
    • what you did
    • what you expected to happen
    • why you expected it to happen
    • why you need it to happen
    • what actually happened instead and
    • why what happened is a problem to you
  • Error message
  • Version numbers of relevant libraries, JDK, tools, operating system etc.
  • Code snippets
  • Stack trace
  • What else you tried/what worked/what didn't work


  • Don't take this as a checklist that you need follow though. It is rather meant as an inspiration on what might be interesting to the people who want to help you. Taking the time to present all of the relevant information demonstrates that you are willing to ShowSomeEffort when presenting your question. Doing so makes it much more likely that someone else will expend some effort to help you.

    It is also possible to provide too much extra information. For example, if you have a 500 line program, go through it and only post the relevant pieces. Try to narrow your problem down as much as possible.


  • [best] My program throws a NullPointerException. Below are the 10 lines of code that don't work. It should calculate the answer to the final question of life, the universe and everything. As you can see from the stacktrace, though, it is throwing the NullPointerException at line 4. I think that is because the mice aren't yet initialized, though I'm doing that in line 1. When I'm initializing them inside the loop (line 3), it runs without the Exception, but of course generates the wrong answer ("41"). I'm using the Universal Question Resolver 0.0.1 beta 3 on JDK 1.7.


  • Also take a look at our other tips on HowToAskQuestionsOnJavaRanch!


    See also

  • http://www.catb.org/~esr/faqs/smart-questions.html#beprecise
  • http://sscce.org/


  • You can read but need at least 5 cow(s) to post
    This thread has been viewed 17463 times.
    Similar Threads
    scroll pane in jpanel help
    Use A Meaningful Subject Line
    how to combine the results after using if statement
    Keep It Down
    Say Thanks
    More...

    All times above are in ranch (not your local) time.
    The current ranch time is
    Jun 30, 2025 19:35:27.