devxlogo

Convert an Operand to a String

Convert an Operand to a String

When one of the two operands is not a string, it is converted to a String as follows:

  • an operand whose type is a primitive type is converted as if by calling toString() on the boxed value.
  • an operand whose type is a reference type is converted by calling the operand’s toString() method.
  • if the operand is null, or if the toString() method returns null, then the string literal “null” is used instead.
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist