Search Interview Questions
| More than 3000 questions in repository.|
There are more than 900 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. = is the assignment operator that assigns the result of the expression on the right to the variable on the left, whereas|
== is the operator to check object equality to see if the reference on left and right are pointing to the same object. For primitive types, its used to check if both variables holds the same value.
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve  =  ==  assignment operator  object equality  difference between Basic|
|Difference between == and .equals() ?|
|Why is null == null returns true ?|
|How is == operator different for objects and primitive types ?|
| 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 ?|