dddddddddddddddddddddddddddddd
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.
dddddddddddddddddddddddddddddd
The compiler is usually correct. Check why.geteggPrawn is undefined for pizza
Without definitions and code, I can't see what is wrong.
That is unusual looking and confusing code.eggPrawn.eggPrawn.seteggPrawn
If you don't understand my answer, don't ignore it, ask a question.
Only answer without seeing the code is that it is coded correctly in one and incorrectly in the other.Why would it work for one but not the other?
If you don't understand my answer, don't ignore it, ask a question.
Why does the compiler find an error?they're definitely the same
If you don't understand my answer, don't ignore it, ask a question.
Do you know why
will work when bacon and prawn are selected, it will say this is not vegetarian, however if i say no to bacon and prawn and choose e.g. cheese it'll crash and won't appear with "this is a vegetarian pizza"
You should post the full text of the error messageit'll crash
AND the code that causes the error.
If you don't understand my answer, don't ignore it, ask a question.
Exception in thread "main" java.lang.NullPointerException
at PizzaChoice.main(PizzaChoice.java:150)
and if (bacon.getType().equals("bacon")||(prawn.getType() .equals("prawn"))) {
sorry about that
--- Update ---
resolved the issue
--- Update ---
Do you know of anyway to say if the user selects an option then they can't select any others?
for example
do you want coke
do you want fanta
if they choose coke then fanta becomes unavailable, creating an illegal argument exception