title: Is there a way to take a string from inside a public static void and move it "outside" into a new class into a public static string?
body: <p>In a small example, I'm trying to take information from the String &quot;helloFromMain&quot; in a file called Main.java and move it &quot;outside&quot; the public static void into a public static string in a different file named data.java.</p>
  <p><strong>IN THE FILE MAIN.JAVA</strong></p>
  <pre><code>public class Main {
     public static void main(String[] args){
         String helloFromMain = &quot;hello&quot;;
     }
  }
  </code></pre>
  <p><strong>IN THE FILE DATA.JAVA</strong></p>
  <pre><code>public class Data {
      public static String helloFromData = helloFromMain;
  }
  </code></pre>
  <p>Any help would be appreciated.</p>
  <p><strong>Also im relatively new to all this</strong></p>