whats the difference between == and .equal ?

Answer Posted / jai

== this is equal to it mainly compares only the values of
the object if both are equal it returns true or else false


eg. a=10,b=20
if (a==b)
it will return false



for the same case it will return false for .equals since
.equals will check only that the objects refr to the same
reference (address) of the instance


clear

Is This Answer Correct ?    1 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between pass by reference and pass by pointer?

491


What are the characteristics of java?

520


What is local class in java?

514


What is core java called?

522


When is finally block not called?

580






What type of value does sizeof return?

531


What is the purpose of java?

556


What is string in java with example?

480


What is output buffer?

565


Why string is not thread safe?

534


What is a predicate method?

560


Does the order of public and static declaration matter in main method?

611


What are the different types of java?

552


Can we override the overloaded method?

559


What is the purpose of main function in java?

533