The conversation between human and AI assistant.
How do you convert a char to a string?
I see. Thank you for explaining that! Can you give me an example of overriding the toString() method in Java?
Sure! Here's an example:

public class Person {
  private String name;
  private int age;

  public Person(String name, int age) {
    this.name = name;
    this.age = age;
  }

  @Override
  public String toString() {
    return "Name: " + this.name + ", Age: " + this.age;
  }
}

In this example, we have a Person class that has a name and age field. We override the toString() method to return a string representation of the Person object by concatenating the name and age fields.