String Methods

AP Computer Science A· difficulty 2/5

String a = "Cat";
String b = "cat";
System.out.println(a.equalsIgnoreCase(b));

What is printed?

  • A

    1

  • B

    0

  • C

    true

    check_circle
  • D

    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?

Related questions