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 2 of 2

Thread: I am getting a null pointer exception. My application gets hanged up. i need to

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I am getting a null pointer exception. My application gets hanged up. i need to

    I am getting an null pointer exception. i need to ignore the exception and the application should continue without hanging. help me.
    names contains the list of data. if some data is not there an exception is thrown..


    int c = names[futidxasset[p]].compareTo(names[a]);
    if( c > 0 )
    return true;
    if( c == 0 )
    return futidxexp[p] > e;
    return false;


  2. #2
    Member
    Join Date
    Jan 2012
    Location
    Hellas
    Posts
    284
    Thanks
    11
    Thanked 59 Times in 57 Posts

    Default Re: I am getting a null pointer exception. My application gets hanged up. i need to

    Quote Originally Posted by rajesh3006 View Post
    I am getting an null pointer exception. i need to ignore the exception and the application should continue without hanging. help me.
    names contains the list of data. if some data is not there an exception is thrown..
    Hello rajesh3006!
    You can place the code that may throw the exception in a try...catch block. You should read the java tutorials for exception handling.
    I don't know what you want to do, but ignoring an exception doesn't seem best practice for me.
    Hope it helps.

Similar Threads

  1. Help with null pointer exception
    By Dr.HughMan in forum Exceptions
    Replies: 35
    Last Post: November 30th, 2011, 09:00 PM
  2. Null Pointer Exception?
    By SeanEE89 in forum What's Wrong With My Code?
    Replies: 10
    Last Post: November 16th, 2011, 06:21 PM
  3. Null Pointer Exception Help !!
    By AlterEgo1234 in forum Member Introductions
    Replies: 1
    Last Post: March 27th, 2011, 11:07 AM
  4. Null Pointer Exception Help!!
    By puzzledstudent in forum What's Wrong With My Code?
    Replies: 5
    Last Post: November 11th, 2010, 06:46 PM
  5. [SOLVED] Null Pointer Exception
    By musasabi in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 11th, 2010, 10:25 PM