# \[java\] "new" not recognized

**URL:** <https://forum.kirupa.com/t/java-new-not-recognized/239536>\
**Category:** programming\
**Created:** [September 23, 2007, 3:13am UTC](https://forum.kirupa.com/t/java-new-not-recognized/239536 "2007-09-23T03:13:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [September 23, 2007, 3:13am UTC](https://forum.kirupa.com/t/java-new-not-recognized/239536/1 "2007-09-23T03:13:33Z")

</div>

I got these errors…

```auto

FileManager.java:38: cannot find symbol
symbol : constructor FileInputStream(java.lang.String[])
location: class java.io.FileInputStream
         this.readFile = new FileInputStream(fileName);
                         ^
FileManager.java:44: cannot find symbol
symbol : constructor FileOutputStream(java.lang.String[])
location: class java.io.FileOutputStream
         this.writeFile = new FileOutputStream(fileName);
                          ^
2 errors

```

… with this code:

```auto

import java.io.*;

public class FileManager
{
   private FileInputStream readFile; // file handler
   private DataInputStream readStream; // reading stream
   private byte readBuffer; // 8 bit reading buffer
   private int bitsInReadBuffer; // how many bits are currently in the 
                                          // reading buffer
   
   private FileOutputStream writeFile; // file handler
   private DataOutputStream writeStream; // writing stream
   private byte writeBuffer; // 8 bit writing buffer
   private int bitsInWriteBuffer; // how many bits are currently in the
                                          // writing buffer
                                          
// ============================================================================
   
   // NAME: FileManager
   // INPUT: string of the file name of the file you want to create
   // RETURN: none
   // PURPOSE: Constructor. Creates a new file. Both read and write buffers
   // will be empty.
   public FileManager(String[] fileName)
   {
      try
      {      
         this.readFile = new FileInputStream(fileName);
         this.readStream = new DataInputStream(this.readFile);
         this.readBuffer = (byte)(0x00);
         this.bitsInReadBuffer = 0;
         
         
         this.writeFile = new FileOutputStream(fileName);
         this.writeStream = new DataOutputStream(this.writeFile);
         this.writeBuffer = (byte)(0x00);
         this.bitsInWriteBuffer = 0;
      }
      catch(Exception e)
      {
         System.err.println("Failed initilialize FileManager object");
      }
   }

// ============================================================================   
    
}

```

I’m trying to make a program that reads and writes bytes to a file. Apparently, “new” is not recognized. ???
