|
Java™ by example!
|
|
|
How do I compare Strings without getting a NullPointerException?
Much can be solved by switching the operands. Eg. Consider the following program: Main.java:
outputs:
A small modification:
outputs:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|