+7  A: 

Check out the signature of your method; it is returning an array of ints.

ts.getCharTimes(file) returns int array. So to print use:

ts.getCharTimes(file)[letter]

You are also running the method 26 times, which is likely to be wrong. Since the call context (parameters and such) is not affected by the iterations of the loop consider changing the code to:

int[] letterCount = ts.getCharTimes(file);
for(int letter = 0; letter < 26; letter++) {
  System.out.print((char) (letter + 'a'));
  System.out.println(": " + letterCount[letter]);
}
Jacob
+2  A: 

ts.getCharTimes(file) returns int array.

print ts.getCharTimes(file)[letter]

Nishu
Thank you!! Worked like a charm!
Kat
and what smink answered
Nishu
A: 

It's not garbage; it's a feature!

public static void main(String[] args) {
    System.out.println(args);
    System.out.println("long:    " + new long[0]);
    System.out.println("int:     " + new int[0]);
    System.out.println("short:   " + new short[0]);
    System.out.println("byte:    " + new byte[0]);
    System.out.println("float:   " + new float[0]);
    System.out.println("double:  " + new double[0]);
    System.out.println("boolean: " + new boolean[0]);
    System.out.println("char:    " + new char[0]);
}
[Ljava.lang.String;@70922804
long:    [J@b815859
int:     [I@58cf40f5
short:   [S@eb1c260
byte:    [B@38503429
float:   [F@19908ca1
double:  [D@6100ab23
boolean: [Z@72e3b895
char:    [C@446b7920

"The classes for arrays have strange names that are not valid identifiers;"—The Java Virtual Machine Specification.

trashgod