Results 1 to 3 of 3
  1. #1
    bbq
    bbq is offline Senior Member
    Join Date
    Jun 2007
    Posts
    132
    Rep Power
    0

    Default Not initialized variable

    Why do I have an error in this line? fis.read(readers);
    This is my code
    Java Code:
    FileInputStream fis;
          File file;
          int sizeFis;
        
    
         file = new File("C:\\fasmw167\\sambler\\textbox 3\\ textbox3.ASM");
          sizeFis = (int) file.length();
         byte readers[] = new byte[sizeFis];
    
          try
          {
    
             fis = new FileInputStream(file);
          }
    
          catch (FileNotFoundException e)
    
          {
    
           }
    
             try
    
          {
    
             fis.read(readers);
    
          }
    
          catch (IOException e)
    
          {
    
       
          }
    
          String s = new String(readers);
    
          jTextArea1.append(s)

  2. #2
    Jack is offline Senior Member
    Join Date
    Jun 2007
    Posts
    130
    Rep Power
    0

    Default

    You have to do like this:

    FileInputStream fis = null;

  3. #3
    Ed
    Ed is offline Senior Member
    Join Date
    Jun 2007
    Posts
    110
    Rep Power
    0

Similar Threads

  1. getting the value of variable
    By Lehane_9 in forum New To Java
    Replies: 2
    Last Post: 03-05-2008, 01:42 AM
  2. Getting variable value from a variable name
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-16-2008, 09:26 PM
  3. Variable No. of Arguments
    By Gajesh Tripathi in forum New To Java
    Replies: 2
    Last Post: 10-31-2007, 02:50 PM
  4. Create a new variable
    By mathias in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:48 AM
  5. String Variable
    By Eric in forum Advanced Java
    Replies: 1
    Last Post: 06-06-2007, 04:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •