title: Java - How to access data initialize from a setter from a third class
body: <p>Main Class/GUI</p>
  <pre><code>public class Testing {
  
      public static void main(String[] args) {
          Request_DB request = new Request_DB();
          Request rq = new Request();
  
          System.out.println(rq.getTest());
          rq.setTest(&quot;SUCCESS&quot;);
          System.out.println(rq.getTest());
          System.out.println(request.getTest());
      }
  }
  </code></pre>
  <p>Request.java</p>
  <pre><code>public class Request {
      protected String test = &quot;Num&quot;;
      
      public String getTest() {
          return test;
      }
      
      public void setTest(String s) {
          test = s;
      }
  }
  </code></pre>
  <p>Request_DB.java</p>
  <pre><code>public class Request_DB extends Request {
  
      public String getTest() {
          return test;
      }
  }
  </code></pre>