PPT Slide
If have method for Class Box:
public String toString ( )
{
String strReturn
strReturn = new String(“Box: length = “ + iLength +
“, Width = “ + iWidth + “height = “ + iHeight);
return strReturn;
} // of toString
Then we can do:
System.out.println
( subwooferBox );
Example of using toString:
Previous slide
Next slide
Back to first slide
View graphic version