title: Strange obstacle in appending strings in java
body: <p>i wanna append some sub string to a string variable that name is Request but it doesn't work and Request stay empty with "" value. it is really strange.
  Request is StringBuilder and  a member of my class.
  Client is an instance of Socket.
  note: tmp is not empty ... </p>
  
  <p>anybody can help me? 
  (codes changed)</p>
  
  <pre><code>class Threading extends Thread
  {
  Socket server;
  Socket client;
  StringBuilder Request;
  
  Threading(Socket sck,Socket srv)
  {
      client = sck;
      server = srv;
      Request = new StringBuilder();
  }
  
  @Override
  public void run() {
      try
      {
          DataOutputStream clientout = new DataOutputStream(client.getOutputStream());
          BufferedReader clientinput = new BufferedReader(new InputStreamReader(client.getInputStream()));
          System.out.println("---------REQUEST--------");
          String tmp ="THIS";
  
          while((tmp=clientinput.readLine())!=null)
          {
              Request = Request.append(tmp);
          }
          System.out.println(Request.toString());//Request is empty!!!
          DataOutputStream srvout = new DataOutputStream(server.getOutputStream());
          BufferedReader srvin = new BufferedReader(new InputStreamReader(server.getInputStream()));
          srvout.write(Request.toString().getBytes());
          while((tmp=srvin.readLine())!=null)
          {
              clientout.write(tmp.getBytes());
          }
      }
      catch(IOException e){e.printStackTrace();}
  }
  </code></pre>
  
  <p>i put all of my class codes.
  Thanks for your replies.</p>