Search Interview Questions
| 3306 questions in repository.|
There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
|Java - Interview Questions and Answers|
|Ans. For objects or references, == operator check if the reference on left and right points to the same object.|
For primitive types or variables, == operator check if the variable on left and right holds the same value.
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve  ==  object equality  operator Basic|
|Difference between == and .equals() ?|
|Why is null == null returns true ?|
|What is the difference between = and == in Java ?|
| What will be the output of following code|
Integer x = 1;
Integer y = 2;
System.out.println(x == y);
What if you change 1 to "1" and Integer to String?
|How can we check equality for Arrays in Java ?|