Re: when using equals method with a null string...




<njzy333@xxxxxxxxx> wrote in message news:1142008176.285334.323620@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello Tony,
That is strange. The difference between your code and my code is that I
declared both strings to be private, and neither are NEWed. I changed
my code according to your example, and I'm still getting an exception.
I guess there is a slight difference in our environment or libraries?
I'm using NetBeans with Java 1.5.
Thanks.

Try running Tony's code exactly as is. If you're getting NPEs, then your Java is broken, and you should uninstall it, redownload it, and reinstall it.

- Oliver

.



Relevant Pages

  • Re: when using equals method with a null string...
    ... That is strange. ... declared both strings to be private, ... I'm using NetBeans with Java 1.5. ...
    (comp.lang.java.programmer)
  • Re: changing access modifier of base method
    ... I'm not sure if this counts as a different meaning than your ... quality in the Java resources I've seen:)). ... design reason for making sealed the default. ... many more private members than public. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Some understanding questions...
    ... > must be private? ... class that has same namespace or not. ... In Java you should be able to do so ... Since there's the notion of "package private" too as I ...
    (microsoft.public.dotnet.vjsharp)
  • Re: find certain strings in java files not inside comments
    ... > I want to determine if there any of the following strings in a java ... > with a list of java files starting at $ARGV. ... > /* blah blah blah ... > foreach(@ARGV) ...
    (comp.lang.perl.misc)
  • Re: Java compatibility issues (WAS: MF having issues?)
    ... I believe, that the JLS (Java Language Specification) REQUIRES that this optimization be done. ... package testPackage; ... true true true true false true ... * Literal strings within different classes in the same package represent references to the same String object. ...
    (comp.lang.cobol)