Java - == vs. method equals()

== vs. method equals().

==Method equals()
It is used to check if two variables point at the same instance of a String object.It is used to compare the values of the Strings.
It is used for object reference comparison in Java.It is used for logical and business logic comparison.
It returns true if two reference are of same object.It depends on overridden implementation.
It is used to compare both primitive and objects.It is used to check equality of objects only.
What are Native methods?
What are Native methods? - Native methods are the methods implemented in other language like C. These methods can be used in Java...
What is Bytecode?
What is Bytecode? - The Java class file contains bytecode which is being interpreted by JVM. Bytecode is introduced in Java to...
this vs. super keyword
this vs. super keyword - 'this' refers to current object instance....
Post your comment