I am currently
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.
I am currently
Last edited by Javaisfrustrating; November 22nd, 2011 at 10:55 PM.
This error message says you are trying to use a variable with a null value at line 52.Exception in thread "main" java.lang.NullPointerException
at DMVExam.getNumCorrect(DMVExam.java:52)
Look at line 52 and see what variable is null and backtrack to see why it does not have a valid value.
If you can not see what variable is null, add a println just before line 52 and print out the values of all the variables used in line 52.
You should follow Norm's advice as it explains how to track down your problems in the future without relying on others. However I have given you a hint.public DMVExam() { char[] solution =
Improving the world one idiot at a time!
Why don't IDEs and compilers give warnings for shadowed variable definitions?
So many students have that problem.
More closer hint:
class A{ private int variable; A(){ int variable; } }