For example if array data represents [3,5,9,10,12,11,9,4], then the code below prints the histogram that follows the code.
Histogram histo = new Histogram();
histo.print(data,20,"x"); // longest bar has 20 "x"'s
The code above prints this histogram.
xxxxx xxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxx
The class Histogram is shown below.