Hi,
I have a constructor
public Road() {
name = DEFAULT_NAME;
number = DEFAULT_NUMBER;
length = DEFAULT_LENGTH;
String read="";
read += toString(name,number,length);
// toString is a function which formats the data into "DEFAULT_LENGTH,DEFAULT_NAME,DEFAULT_NUMBER, DEFAULT_NUMBER";
}
Then in main I have
Road roadOne = new Road();
System.out.println(roadOne);
How do i get it so that it will print "DEFAULT_LENGTH,DEFAULT_NAME,DEFAULT_NUMBER, DEFAULT_NUMBER", without changing anything in main