Multiple choice

The method 'region Matches' can take a maximum of ___ arguments.

  1. 2

  2. 5

  3. 4

  4. 7

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The regionMatches() method in Java's String class has two overloaded versions - one taking 4 arguments and another taking 5 arguments. The 5-argument version includes an additional boolean parameter to ignore case differences. Therefore, the maximum is 5 arguments.