up previous next contents
Next: Native Methods Up: Classes and objects Previous: Garbage collection and finalize   Contents

The toString() Method

  • If an object supports a public toString method that takes no parameters and returns a String object, that method is invoked whenever a + or += expression has an object of that type where a String object is expected.
  • All primitive types are implicitly converted to String objects when used in String expressions.


up previous next contents
Next: Native Methods Up: Classes and objects Previous: Garbage collection and finalize   Contents