Παράδειγμα (τυπώνει ένα δέντρο):
import gr.aueb.dds.BIO;
class XmasTree {
private static final int treeWidth = 20;
public static void main(String args[])
{
int i;
for (i = 1; i < treeWidth; i = i + 2) {
int j;
// Initial spaces
for (j = 0; j < (treeWidth - i) / 2; j++)
BIO.print(' ');
// Draw tree body
for (j = 0; j < i; j++)
BIO.print('*');
BIO.println();
}
}
}