title: Display file name in println
body: <p>I am trying to  figure out how to display my file name in the println the the following code using the file object properties. I am new to this and could use some guidance in the right direction. The idea is to have "Excercise19_2.txt" displayed on the console. I hope that makes it clearer to everyone. Thanks for your help!</p>
  
  <pre><code>package chp19_1_b;
  import java.io.*;
  
  public class Excercise19_1_b {
      public static void main(String[] args) throws ClassNotFoundException, IOException {
          int[] numbers = {1, 2, 3, 4, 5};
  
          ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream("Excercise19_2.txt"));
  
          output.writeObject(numbers);
          output.writeObject(new java.util.Date());
          output.writeDouble(5.5);
  
          output.close();
  
          ObjectInputStream input = new ObjectInputStream(new FileInputStream("Excercise19_2.txt"));
  
          //Print FileName
          ;
  
          int[] newNumbers = (int[])(input.readObject());
  
          //Print array
          System.out.println("Integers: ");
          for (int i = 0; i &lt; newNumbers.length; i++)
              System.out.println(newNumbers[i] + ", ");
  
          //Print date
          java.util.Date date = (java.util.Date)(input.readObject());
          System.out.println("DateTime: " + date);
  
  
          //Print double
          double number = input.readDouble();
          System.out.println("Double: " + number);
  
  
          input.close();
      }
  }
  </code></pre>