I'm trying to make a 'histogram' in java and running into trouble with some formatting. I've got the below loop for printing a frequency distribution table: 

```
for (int i = 0; i < 10; i++) {
        char asterisk[] = new char[frequency[i]];
        Arrays.fill(asterisk, '*');
        System.out.println(asterisk);
        freqTable = bins[i] + "\t";
        System.out.println(freqTable);
    }

```

But this produces an output like:

```
************
1-10    
**********
11-20   
**********
21-30

```

And i'd like to have it print like this:

```
1-10 ************
11-20 **********
21-30 **********

```

No idea how to get it to do this! Tried using toString(), didn't get anywhere though. 

Thanks in advance!