Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

  • Common Java Mistakes


    Here's a list of common problems you can encounter when programming in Java. Anyone else can feel free to add to this list. I'll try to update this "table of contents" when I can. Do not post in this topic requesting help with a problem you have.

    Compile-time Problems

    This category will cover a variety of problems with compiling your code. On compile, you will immediately be notified of these errors. They are fairly easy to find and fix.

    Common Run-time errors

    This section is for common problems you could encounter at run-time. These problems usually are the direct cause of a crash. In general, these problems are a little more difficult to find, and may or may not be easy to fix.

    • Forgetting to initialize a variable
      • Permanent link: http://www.javaprogrammingforums.com/java-code-snippets-tutorials/5518-common-java-mistakes.html#post18688
    • Out of Memory Error
      • Permanent link: http://www.javaprogrammingforums.com/java-code-snippets-tutorials/5518-common-java-mistakes-2.html#post20021

    Logic problems

    This section is for common problems with logic. These problems usually result in the outputs being wrong, which in turn could crash another part of your program, though they do not need to (in fact, the ones that don't crash are the most difficult to find and fix). These can be very difficult to find and are also the hardest to fix even when you find the problem. You are probably better off putting a post inside the appropriate forum category (Again, do not post in this topic requesting help for specific problems you are having).

    Contributing to this list

    Please follow the template outlined in this post.
    This article was originally published in forum thread: Common Java Mistakes started by helloworld922 View original post