This message has been deleted.
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.
This message has been deleted.
Last edited by Jstew2408; October 24th, 2011 at 11:07 PM.
It would help if you posted this in your other thread which contains the code.
Improving the world one idiot at a time!
This message has been deleted.
Last edited by Jstew2408; October 24th, 2011 at 11:05 PM.
On line 1 you call indexOf method on the alphabet variable. On line 3 you assign the alphabet variable to have the same value as the abcdefg... variable AND NOT the String "abcdefg..." not sure what you are trying to do. On line 2 the abcdefg... variable is null. Therefore alphabet is also null. So on line 1 you actually have null.indexOf which gives you the NullPointerException.
Improving the world one idiot at a time!
This message has been deleted.
Last edited by Jstew2408; October 24th, 2011 at 11:05 PM.
We don't need you posting the full assignment. Did you read my reply? It explains what you are doing wrong. If you don't understand what I said then ask a specific question.
Improving the world one idiot at a time!
How do I create a:
instance variable key?
private static final String with the alphabet?
constructor with an int parameter?
and a constructor with a key to be passed in value?
The only problem is that you have not initialised the alphabet variable to a String. Perhaps you meant to do this
Notice the difference.private static final String alphabet = "abcdefghijklmnopqrstuvwxyz";
Improving the world one idiot at a time!
What is the difference?
:headdesk:
Improving the world one idiot at a time!
Jstew2408, please do not delete your posts....this defeats the purpose of these forums as a place to get help, both for yourself and for others in the future with similar problems. I for one would like to help, but have no clue what the problem is because you deleted it. And I can only speak for myself, but deleting things like this isn't necessarily encouraging me to try to help you, now or in the future.