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. Any reference in java that doesn't point to any object , gets assigned null i.e is a reference to null. Two object references in java are treated equal if they point to the same memory. That's Why null == null results true.|
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve  java   null   equality   references|
|Difference between == and .equals() ?|
|What is the difference between = and == in Java ?|
|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 ?|