title: How to pass methods as parameters in Android
body: <p>This may be a really stupid question or not even possible. </p>
  
  <p>I am not sure if this would be called as a method, but going with this. How can I pass getCountryName(); as parameter? like show below;</p>
  
  <pre><code>public static String Utils(Something something){
      Geocoder geoCoder = new Geocoder(context, Locale.getDefault());
      List&lt;Address&gt; address = null;
  
      if (geoCoder != null) {
          try {
              address = geoCoder.getFromLocation(lat, lng, 1);
          } catch (IOException e1) {
              e1.printStackTrace();
          }
          if (address.size() &gt; 0) {
              return address.get(0).getCountryName(); // pass this as parameter (something)
          }
      }
      return null;
  }
  </code></pre>
  
  <p>and then call it like so,</p>
  
  <pre><code>Utils(getCountryName());
  Utils(getCountryCode());
  etc.
  </code></pre>