title: Simple TCP connection program, what am I looking at, and how can I fix it?
body: <p>I am currently creating a simple client that requests the Time from a host, and prints whatever the response is. I am very confused as to what I am looking at, as the output is something I have never seen before. Here is my client code, </p>
  
  <pre><code>import java.io.*;
  import java.net.*;
  import java.util.*;
  
  /*
   * 
   * Time tcp client
   */
  
  
  public class TimeTcp {
  
      public final static int TIME_PORT = 37;
      public final static int SIZE = 1024;
  
  
  public static void main(String[] args) throws IOException {
  
      if(args.length &lt; 1) {
          System.out.println("usage: java TimeTcp host");
          System.exit(1);
      }
      String host = args[0];
      Socket socket = new Socket(host, TIME_PORT);
      DataInputStream fromServer = new DataInputStream(
                                  socket.getInputStream());
  
  
      byte[] read = new byte[SIZE];
  
      fromServer.read(read);
  
      System.out.println(read.toString());
      }
  }
  </code></pre>
  
  <p>However, my output looks like this: <code>[B@4e25154f</code>
  Literally, that's all it prints.
  What am I doing wrong? Am I supposed to convert something?</p>
  
  <p>Thanks! </p>
  
  <p>EDIT: Thanks to kolossus for helping me figure out what I am looking at. However, What I am supposed to be printing out is the Time gotten from the Time server that I am calling from. I am trying to use the byte array to read in whatever the server sends back as the time, then read it into a single variable, then convert it into a value that can be used by Java (the Time server protocol sends 32 bit unsigned values, and Java doesn't support those) so that it can be printed back to the user that called the client. Is there a good way to do this?</p>