Monday, April 30, 2007

How is '==' different from .equals() method in case of String objects?

In case of String objects:

'==': does reference check

while .equals() method: checks the contents of the two String objects.

The following example will illustrate the difference between the two:

0 comments :

 

Disclaimer
Interview Questions On Java,Java EE Copyright © 2017. Reads: best tracker