Leave a Reply 4

Your email address will not be published. Required fields are marked *


hassan

hassan

its choice D.
Explanation/Reference:
Explanation: Strings can not be compared with the usual <, , or >= operators, and the == and != operators
don’t compare the characters in the strings. So the first if statement fails.
Equals works fine on strings. But it does not work here.The second if-statement also fails. The StringBuffer
class does not override the equals method so it uses the equals method of Object. If a and b are two objects
from a class which doesn’t override equals, thena.equals(b) is the same as a == b