Header Ads

  • Breaking Now

    How is '==' different from .equals() method in case of String objects?

    In case of String objects:

    '==': does reference check

    while .equals() method: checks the contents of the two String objects.

    The following example will illustrate the difference between the two:

    Post Top Ad

    Post Bottom Ad