toString()

Converts the current value of any object to a String.

Syntax

String  toString()

This method does not do anything, as a String is already a String. It is included in the String class, as this method exists for ALL classes. You can use the toString() method on an object of the Color class, of the Date class, and so on.

Example

In this example, the String value remains a String value. It is syntactically correct, yet it has no effect on the value.

orderline.account.firstname.toString()