Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Trying to print an array, getting ascii code instead.

$
0
0
import java.util.Arrays;

public class TestSort {
    public static void main(String[] args) {
            
        
        Comparable[]  compList;
        compList = new Comparable[4];
        compList[0] = "Bob";
        compList[1] = "Dan";
        compList[2] = "Alice";
        compList[3] = "Chuck";
        System.out.println(compList);
   }
}




This prints out the ascii codes and I cant figure out why. I'm just trying to print out the the names in order. If anyone could help me out I would be very appriciative.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>