I assume you are asking how to define a class's toString() method.
Read the API doc for Object class's toString method.
For the Ant class, say you want to see some of its instance variables.
...
Type: Posts; User: Norm
I assume you are asking how to define a class's toString() method.
Read the API doc for Object class's toString method.
For the Ant class, say you want to see some of its instance variables.
...
System.out.println(ant);
If that is the statement that you must use to print out the contents of an Ant instance and you are not allowed to add a toString() method to your class, then the output...