Difference between == and .equals() method in java

  • == equality operator is used to check the relation between primitive data type such as boolean, int char, double, etc and compare the value of two object references to see whether they refer the same string instance or not.
  • equals method compare the value of String object whether they are equal or not.



Post a Comment

0 Comments