title: To get the values in Constructor From the method of another Class?
body: <p>I want to access the value of name and age in the constructor of the class Choose where I mentioned public Choose(){
  Which are stored in GetValues method of NewP</p>
  
  <p><strong>Choose.java</strong></p>
  
  <pre><code>class Choose {
      String Cn,Ca;
      public Choose(){
          btn.addMouseListener{
          }
      }
  
      public static void gtNp(string nn,string aa) {
          Cn=nn;
          Ca=aa;
      }
  
  }
  </code></pre>
  
  <p><strong>NewP.java</strong></p>
  
  <pre><code>class NewP {
      Choose C1 = new Choose();
  
      NewP() {
         btn.addMouseListener{
             GetValues();
             Choose.gtNp(name,age);       
         }
      }
  
      public NewP GetValues(){
          Name=         ;
          Age=            ;
          return null;
      }
  
  }
  </code></pre>