title: How to pass a string from one method to another method in Java
body: <p>I declared string:</p>
  
  <pre><code>private String name;
  </code></pre>
  
  <p>1st method:</p>
  
  <pre><code>private void showJSON(String response){
      name = collegeData.getString(Config.KEY_NAME);
  }
  </code></pre>
  
  <p>I want to use the value of name in this method:</p>
  
  <pre><code>private void setRealmData() {}
  </code></pre>