I constructed a class with one String field. Then I created two objects and I have to compare them using == operator and .equals() too
String
==
.equals()
The overwrite function equals() is wrong. The object "a" is an instance of the String class and "object2" is an instance of the MyClass class. They are different classes, so the answer is "false".