title: Cant Call a method from another class in java
body: <p>I have a class loadDAta() which contains a method to get the json from the server say loadData(String url). i am calling this according to the option items</p>
  
  <pre><code>import android.text.format.DateFormat;
  import com.loopj.android.http.AsyncHttpClient;
  import com.loopj.android.http.JsonHttpResponseHandler;
  import org.json.JSONException;
  import org.json.JSONObject;
  import java.util.Date;
  import cz.msebera.android.httpclient.Header;
  
  public class loadDAta{
          private AsyncHttpClient client=new AsyncHttpClient();
  
  public void loadDatas(String url) {
  
      client.post(url, new JsonHttpResponseHandler() {
  
          @Override
          public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
              super.onSuccess(statusCode, headers, response);
              try {
                 int st = response.getInt("st");
                 int timest = response.getInt("t");
                 Date dateTime = new Date(timest);
                 String dateString = (String) DateFormat.format("dd:MM:yyyy \t\t  hh:mm:ss", dateTime);
                 double val = response.getDouble("v");
                  Data data=new Data();
                  data.setDate(dateString);
                  data.setValue(val);
                  data.setState(st);
  
  
              } catch (JSONException e) {
                  e.printStackTrace();
              }
  
          }
      });
  }
  </code></pre>
  
  <p>I am setting those values in another class called Data()</p>
  
  <pre><code>public class Data {
  private String date,url;
  private double value;
  private int state;
  
  
  public String getDate() {
      return date;
  }
  
  public void setDate(String date) {
      this.date = date;
  }
  
  public double getValue() {
      return value;
  }
  
  public void setValue(double value) {
      this.value = value;
  }
  
  public int getState() {
      return state;
  }
  
  public void setState(int state) {
      this.state = state;
  }
  public String getURL() {
      return url;
  }
  
  public void setURL(String url) {
      this.url = url;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>the operation inside the loadData() method is not performing when i called like this from another class</p>
  
  <pre><code>loadDAta lds=new loadDAta();
          lds.loadDatas(myUrl);
  
   Data dat=new Data();
      date1=dat.getDate();
      val=dat.getValue();
      st=dat.getState();
  </code></pre>
  
  <p>then the value getting here is, when it Is string then nothing, when it is int then 0 , and when it Is double then 0.0</p>
  
  <p>is there any problem in my code against that method call....</p>