Menu

StringLiteral as subtype of ReferencePrefix?

Developers
widheg
2010-02-22
2012-10-08
  • widheg

    widheg - 2010-02-22

    Hi!
    Can someone give an example of Java source code where a StringLiteral as a
    subtype of ReferencePrefix appears?
    Thanks!

     
  • Tobias Gutzmann

    Tobias Gutzmann - 2010-02-22

    Hej!

    Sure:
    "Hello, world".equals(obj);

    Note that this can be considered good coding practice, as it avoids that any
    NullPointerException might occur. obj.equals("...") may cause such an
    exception.

    Regards,
    Tobias

     

Log in to post a comment.