The way that is written it can be reduced toNote that putting the String literal on the left obviates any risk of an exception if the str1 reference points to null. That is why Knute called that construct better. If however str1 points to null or any text other than "help", it will return false, and the subexpression to the right of && is never evaluated, and the block is never entered.
I was taught to beware of == and similar on floating point numbers. The tiny imprecisions intailed by floating point arithmetic mean that comparisons are likely to give unexpected results. Try this:-Remembering that this constructor tells you the exact value of 0.1, I challenge you to pedict what that code will print. Integer arithmetic is accurate, and the tiny differences between similar calculations do not exist, so you should always use integers for such comparisons. That is probably why your problems reduced when you stopped using doubles. You should also use descriptive names for your variables; “Odd” is very difficult to understand. And don't start variable names with Capital Letters.
If line 1 is the issue then you would need to show more code from prior to this.
For a NullPointerException we would need to see the code around this to see where objects are assigned.
Simply saying "I assigned XYZ earlier" doesn't help since you clearly missed something, otherwise you wouldn't be getting the NPE.
Also, if you get an exception it is usually a good idea to post the full stack trace.
There might be something in there you missed.