Never mind, I figured out what I had to do
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.
Never mind, I figured out what I had to do
Last edited by noel222; February 1st, 2012 at 07:12 PM.
What errors? Post them in their entiretybut I am getting exception errors,
The error is
Exception in thread "main" java.lang.NullPointerException
I am not really sure what is wrong, and have been trying for a very long time to get this code working, but can't seem to.
That is not the full exception - it should contain line numbers which tell you exactly where the exception is being thrown. Even then, we cannot match those line numbers up to your code given they are just small snippets (why we typically ask for an SSCCE). Find that line number and determine what is null - using System.out.println to print objects would be a first place to start to determine what is null and then backtrack to findthe cause.
This issue is with calling the method on object whose value is null.
so make sure you write a one condition (if obj!=null) before calling a method to avoid the exceptions. This is always good idea to check for validating object