what is difference between equals to and compare to functions in java
Answers
Answered by
1
In general both equals() and “==” operator in Java are used tocompare objects to check equality but here are some of the differences between the two: ... In simple words, == checks if both objects point to the same memory location whereas .equals() evaluates to thecomparison of values in the objects
Answered by
5
Equals To ( )
This function is used to
compare two strings together
to check whether they are
identical are not . It returns
boolean type value .
Compare To ( )
It is used to compare two
strings . It not only checks the equality of a string but also checks whether a string is bigger or smaller than the other
This function is used to
compare two strings together
to check whether they are
identical are not . It returns
boolean type value .
Compare To ( )
It is used to compare two
strings . It not only checks the equality of a string but also checks whether a string is bigger or smaller than the other
Similar questions