title: Java code to copy all the text while converting upper case letters from one text file to lower case letters in another text file
body: <p>I am having problem with the code that I wrote to convert upper case letters from one file to lower case letters in another. When the code is run for some text file named inputtext.txt it creates the output file but the upper case text aren't being converted.</p>
  
  <pre><code>import java.io.*;
  
  public class TextFile {
      public static void main (String[] args) throws IOException {
      // Assume default encoding.
           // The name of the file to open for reading.
              File filein = new File("inputtext.txt");
           // The name of the file to open for writing.
              File fileout = new File("outputtext.txt"); 
              char CharCounter = 0;       
              BufferedReader in = (new BufferedReader(new FileReader(filein)));
              PrintWriter out = (new PrintWriter(new FileWriter(fileout)));
  
              int z;
              while ((z = in.read()) != -1){
  
                  if (Character.isUpperCase(z)){
                      Character.toLowerCase(z);
  
                  }
                  out.write(z);
  
  
              }
              // Always close files.
              in.close();
              out.close();
          }       
      }
  </code></pre>