title: How access values from different classes without using parameters in java?
body: <p>For example, my program is like that,
  one java file,this is my fixed class.</p>
  
  <pre><code>class Dynamic{
   String s;
    public void program(){
     System.out.println(s);
     }
  }
  </code></pre>
  
  <p>here another java file,this is class dynamic,</p>
  
  <pre><code>class Source{
   public static void main(String[] args)
   {
   String s = "Hello world";
   Dynamic d=new Dynamic();
   d.program();
   }}
  </code></pre>
  
  <p>I want to print s in dynamic class. And I don't want to use s as a parameter and also If I changes my sources class, it will works. Is any other method is there?</p>