1.

Function equals() is _______________ and equalIgnoreCase() is _________________(a) Case Insensitive, case insensitive(b) Case sensitive, Case insensitive(c) Case sensitive, case sensitive(d) Case insensitive, case sensitiveI have been asked this question during an interview.Origin of the question is String Class topic in section Inbuilt Classes of Object Oriented Programming

Answer»

Right answer is (b) CASE sensitive, Case insensitive

The best I can EXPLAIN: Both the functions RETURN Boolean VALUE. The function equal() is case sensitive and returns false even if a single character is case DIFFERENT in two strings. The other function ignores the case sensitivity and only checks if the spellings are same.



Discussion

No Comment Found

Related InterviewSolutions