Is it possible to simply check a java String argument is present and return a boolean true or return false if the argument is of a Null value?
Son of a gun
0
Newbie Poster
Recommended Answers
Jump to Postboolean isNull = stringArg == null;
Jump to PostYour logic looks OK (except you need == to test for equality, not just =), but pretty lengthy and redundant - how about:
public boolean myWordIsNull(String word) { return word == null; }
All 6 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Son of a gun
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Son of a gun
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Son of a gun
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.