Archie Cobbs wrote:
> Simon Kitching wrote:.
> > * Class.getName returns strings that have been interned. I don't
> >   think this is explicitly required by the java specs but is
> >   certainly true for Sun's JVM and seems likely to be done by
> >   any sensible JVM.
> 
> I.e., is there something special about class names which means
> they should be treated differently from any other String randomly
> created and used in a Java application? (rhetorical question)
> Otherwise, why not intern all Strings? Etc.
> 
> In any case, to provide two concrete counter-examples:
> 
>    $ cat > zz.java
>    public class zz {
>      public static void main(String[] args) {
>          zz z = new zz();
>          System.out.println(z.getClass().getName() == "zz");
>      }
>    }
>    $ javac zz.java
>    $ java zz
>    true
>    $ jc -Xint zz
>    false
>    $ jamvm zz
>    false

$ ikvm zz
true

He did say "any sensible JVM"... <gd&r>

Regards,
Jeroen


_______________________________________________
Classpath mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to