the toString() method is a representative of your object. Let me show you an example:
public class NewTo
{
//varaibles
double x;
double y;
//contructor
public NewTo(double x, double y)
{
this.x = x;
this.y = y;
}
//methods
public String toString()
{
return x + "/" + y;
}
//Main method
public static void main(String[] args)
{
NewTo Java = new NewTo(5,2);
System.out.println(Java);
}
}