title: getMethod return null java
body: <p>I wrote getMethod in the file MovieReader and if I print this method inside this file everything is working well. </p>
  
  <pre><code>import java.io.BufferedReader; // scanner
  import java.io.FileReader;
  public class MovieReader {
  
      private static String text;
  
      public static void main(String args[]) throws Exception {
          FileReader file = new FileReader("C:/Users/krystian/Desktop/filmDateBaseProject/movies.txt");
          BufferedReader reader = new BufferedReader(file);
          text = "";
          String line = reader.readLine();
          while(line != null) {
              text+= line +"\n";
              line=reader.readLine();
          }
          reader.close();
          System.out.println(getText()); // This method works
      }
  
      public static String getText() {
          return text;
      }
  
  }
  </code></pre>
  
  <p>But when I'm trying to call this method from other file it's printing null</p>
  
  <pre><code>public class Userr{
  
     public static void main(String args[]){
  
        MovieReader user = new MovieReader();
  
        System.out.println(user.getText());
  
    }
  }
  </code></pre>
  
  <p>Can you help me with it?</p>