String a = "Cat";
String b = "cat";
System.out.println(a.equalsIgnoreCase(b));What is printed?
- A
1
- B
0
- Ccheck_circle
true
- D
false
Explanation
equalsIgnoreCase compares without regard to case, so "Cat" and "cat" are considered equal.
AP Computer Science A· difficulty 2/5
String a = "Cat";
String b = "cat";
System.out.println(a.equalsIgnoreCase(b));What is printed?
1
0
true
false
Explanation
equalsIgnoreCase compares without regard to case, so "Cat" and "cat" are considered equal.
Want 10 more like this — adaptive to your weak spots?
<code"abcdef".substring(2, 5)</code returns…
chevron_rightConsider: <code class="language-java"String s = "ABCDE"; String t = s.substring(2, 2) + s.substring(1, 4) + s.substring(5); System.out.print("[" + t + "]"); </c…
chevron_rightWhat does <code"".length()</code return?…
chevron_right