Java OCA OCP Practice Question 709


Which of the following operators can be used in conjunction with a String object?

Select 3 options

  • A. +
  • B. ++
  • C. +=
  • D. .
  • E. *

Correct Options are  : A C D


Only + is overloaded for String.

a+=x is actually converted to a = a + x. so it is valid for Strings.

dot (.) operator accesses members of the String object.

There is only one member variable though: CASE_INSENSITIVE_ORDER.

It is of type Comparator which is an interface.