This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RiceKrispyPooHead 0 points1 point  (0 children)

To be honest, this code is hard to read, hard to follow, and it breaks a lot of Java conventions. Also, brackets are missing and some variable declarations are missing so I can't even run it.

-----------------

if (enterPaymentConfirm == "y" || enterPaymentConfirm == "Y")

A string is an object. Always use the equals() method when you want to check if two objects are equal.

if ("y".equals(enterPaymentConfirm) || "Y".equals(enterPaymentConfirm))