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.


>> REGISTER NOW TO START POSTING


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

Results 1 to 9 of 9

Thread: How to solve “NullPointerException” in my Java Program ?

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Wink How to solve “NullPointerException” in my Java Program ?

    I just started java programming a 2 month ago , then i wrote a library system, but inside are full of “NullPointerException” , i have try many time but still cant solve it ,anyone here willing to help me to solve my problems and point out my program error ?
    Attached Files Attached Files


  2. #2
    Member
    Join Date
    Jul 2012
    Posts
    83
    My Mood
    Cynical
    Thanks
    3
    Thanked 9 Times in 9 Posts

    Default Re: How to solve “NullPointerException” in my Java Program ?

    Post your code here, especially the line causing the NPE. First try to find which variable on the line is null. A debugger or debug statements (println) can help you here.

  3. #3
    Junior Member
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to solve “NullPointerException” in my Java Program ?

    I have attach my program here, because is quite long , i thought is quite troublesome for you guys to read

  4. #4
    Junior Member
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to solve “NullPointerException” in my Java Program ?

    This is download link of my program source codes java.doc.rar, please help me solve my problems as I really cannot solve it

  5. #5
    Junior Member
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to solve “NullPointerException” in my Java Program ?

    java.doc.rar << my source codes

  6. #6
    Member
    Join Date
    Jul 2012
    Posts
    83
    My Mood
    Cynical
    Thanks
    3
    Thanked 9 Times in 9 Posts

    Default Re: How to solve “NullPointerException” in my Java Program ?

    It's looking like folks don't want to see your whole program, particularly if they have to download it and particularly if it's long. If you still need our help and no decent answer is posted soon, you'll want to consider finding the line that's causing the NPE (the error message will tell you), investigate the variables on that line to see which are null, and then give this information with some of your code, preferably an SSCCE. Also, why are you reposting your link several times? That can get a bit annoying.

  7. #7
    Member
    Join Date
    Jul 2012
    Posts
    119
    Thanks
    0
    Thanked 19 Times in 19 Posts

    Default Re: How to solve “NullPointerException” in my Java Program ?

    don't like to download...unknown things. Just post the codes you suspected

  8. #8
    Junior Member
    Join Date
    Jun 2012
    Location
    Negombo, Sri Lanka
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to solve “NullPointerException” in my Java Program ?

    My friend, No one is gonna download and check your source code; specially unknown files.. Just post the code here, then we can help you to sort out your problem..

  9. #9
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 262 Times in 231 Posts

    Default Re: How to solve “NullPointerException” in my Java Program ?

    Quote Originally Posted by unknowny View Post
    Wink How to solve “NullPointerException” in my Java Program ?
    ...initialize your variables.

    post the code, or the error messages, and someone can tell you which variable. (or read the error message yourself and it will tell you)

Similar Threads

  1. Solve the recurrence in java plzzzzzz
    By inthu in forum Algorithms & Recursion
    Replies: 5
    Last Post: December 13th, 2011, 07:25 AM
  2. Replies: 1
    Last Post: August 2nd, 2011, 05:13 PM
  3. NullPointerException when running program...
    By RiskyShenanigan in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 12th, 2011, 03:30 PM
  4. how I can solve this program ?
    By Noni in forum Object Oriented Programming
    Replies: 9
    Last Post: January 20th, 2011, 04:33 PM
  5. [SOLVED] Getting NullPointerException in program
    By jmack in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 20th, 2011, 12:48 PM