what is == operator in java?

  • This method is used for used to check the equality of objects.
  • it is an operator applicable for both primitives & object references.
  • == operator mens for reference comparison.
  • if two references pointing to same object then only == operator returns "true".
  • for incse of heterogenoeous type objects == operator causes compiletime error saying incompitable types.
  • for any object reference r, r == null is always false.

No comments:

Post a Comment