title: Android Java expected begin_object but was begin_array
body: <p>Please Help me</p>
  <p>This is my Models</p>
  <p><strong>Cases class</strong></p>
  <pre><code>public class Cases {
  
  @SerializedName(&quot;new&quot;)////this key value from json
  @Expose
  private String _new;
  @SerializedName(&quot;active&quot;)
  @Expose
  private Integer active;
  @SerializedName(&quot;critical&quot;)
  @Expose
  private Integer critical;
  @SerializedName(&quot;recovered&quot;)
  @Expose
  private Integer recovered;
  @SerializedName(&quot;1M_pop&quot;)
  @Expose
  private String _1MPop;
  @SerializedName(&quot;total&quot;)
  @Expose
  private Integer total;
  
  public String getNew() {
      return _new;
  }
  
  public void setNew(String _new) {
      this._new = _new;
  }
  
  public Integer getActive() {
      return active;
  }
  
  public void setActive(Integer active) {
      this.active = active;
  }
  
  public Integer getCritical() {
      return critical;
  }
  
  public void setCritical(Integer critical) {
      this.critical = critical;
  }
  
  public Integer getRecovered() {
      return recovered;
  }
  
  public void setRecovered(Integer recovered) {
      this.recovered = recovered;
  }
  
  public String get1MPop() {
      return _1MPop;
  }
  
  public void set1MPop(String _1MPop) {
      this._1MPop = _1MPop;
  }
  
  public Integer getTotal() {
      return total;
  }
  
  public void setTotal(Integer total) {
      this.total = total;
  }
  </code></pre>
  <p>}</p>
  <p><strong>Deaths class</strong></p>
  <pre><code>public class Deaths {
  
  @SerializedName(&quot;new&quot;)
  @Expose
  private String _new;
  @SerializedName(&quot;1M_pop&quot;)
  @Expose
  private String _1MPop;
  @SerializedName(&quot;total&quot;)
  @Expose
  private Integer total;
  
  public String getNew() {
      return _new;
  }
  
  public void setNew(String _new) {
      this._new = _new;
  }
  
  public String get1MPop() {
      return _1MPop;
  }
  
  public void set1MPop(String _1MPop) {
      this._1MPop = _1MPop;
  }
  
  public Integer getTotal() {
      return total;
  }
  
  public void setTotal(Integer total) {
      this.total = total;
  }
  </code></pre>
  <p>}</p>
  <pre><code>public class Errors {//this is empty class
  </code></pre>
  <p>}</p>
  <pre><code>public class Parameters {//this is empty class
  </code></pre>
  <p>}</p>
  <p><strong>Tests class</strong></p>
  <pre><code>public class Tests {
  
  @SerializedName(&quot;1M_pop&quot;)
  @Expose
  private String _1MPop;
  @SerializedName(&quot;total&quot;)
  @Expose
  private Integer total;
  
  public String get1MPop() {
      return _1MPop;
  }
  
  public void set1MPop(String _1MPop) {
      this._1MPop = _1MPop;
  }
  
  public Integer getTotal() {
      return total;
  }
  
  public void setTotal(Integer total) {
      this.total = total;
  }
  </code></pre>
  <p>}</p>
  <p><strong>Response class</strong></p>
  <pre><code>public class Response {
  @SerializedName(&quot;continent&quot;)
  @Expose
  private String continent;
  @SerializedName(&quot;country&quot;)
  @Expose
  private String country;
  @SerializedName(&quot;population&quot;)
  @Expose
  private Integer population;
  @SerializedName(&quot;cases&quot;)
  @Expose
  private Cases cases;
  @SerializedName(&quot;deaths&quot;)
  @Expose
  private Deaths deaths;
  @SerializedName(&quot;tests&quot;)
  @Expose
  private Tests tests;
  @SerializedName(&quot;day&quot;)
  @Expose
  private String day;
  @SerializedName(&quot;time&quot;)
  @Expose
  private String time;
  
  public String getContinent() {
      return continent;
  }
  
  
  public String getCountry() {
      return country;
  }
  
  public Integer getPopulation() {
      return population;
  }
  
  
  
  public Cases getCases() {
      return cases;
  }
  
  
  public Deaths getDeaths() {
      return deaths;
  }
  
  
  public Tests getTests() {
      return tests;
  }
  
  
  public String getDay() {
      return day;
  }
  
  
  public String getTime() {
      return time;
  }
  </code></pre>
  <p>}</p>
  <p><strong>Covid19Model class</strong></p>
  <p>public class Covid19Model {</p>
  <pre><code>@SerializedName(&quot;get&quot;)
  @Expose
  private String get;
  @SerializedName(&quot;parameters&quot;)
  @Expose
  private Parameters parameters;
  @SerializedName(&quot;errors&quot;)
  @Expose
  private Errors errors;
  @SerializedName(&quot;results&quot;)
  @Expose
  private Integer results;
  @SerializedName(&quot;response&quot;)
  @Expose
  private List&lt;Response&gt; response;
  
  public String getGet() {
      return get;
  }
  
  public void setGet(String get) {
      this.get = get;
  }
  
  public Parameters getParameters() {
      return parameters;
  }
  
  public void setParameters(Parameters parameters) {
      this.parameters = parameters;
  }
  
  public Errors getErrors() {
      return errors;
  }
  
  public void setErrors(Errors errors) {
      this.errors = errors;
  }
  
  public Integer getResults() {
      return results;
  }
  
  public void setResults(Integer results) {
      this.results = results;
  }
  
  public List&lt;Response&gt; getResponse() {
      return response;
  }
  
  public void setResponse(List&lt;Response&gt; response) {
      this.response = response;
  }
  </code></pre>
  <p><strong>Covid19WebAPI interface</strong></p>
  <pre><code>public interface Covid19WebApi {
  
  @Headers({
          &quot;x-rapidapi-host:covid-193.p.rapidapi.com&quot;,
          &quot;x-rapidapi-key:fb818f40c4msh9ed8e59abf0e867p11b3bfjsn0900d33b78ef&quot;//this is my rapidapi key 
  })
  
  @GET(&quot;statistics&quot;)
  Call&lt;Covid19Model&gt; getData();
  </code></pre>
  <p>}</p>
  <p><strong>MainActivity class</strong></p>
  <pre><code>public class MainActivity extends AppCompatActivity {//This is my app MainActivity
  
  
  List&lt;Response&gt; responses;
  private static final String BASE_URL = &quot;https://covid-193.p.rapidapi.com/&quot;;//this is covid api website  
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      Retrofit.Builder builder = new Retrofit.Builder()
              .baseUrl(BASE_URL)
              .addConverterFactory(GsonConverterFactory.create());//this is convert json 
  
      Retrofit retrofit = builder.build();
  
      Covid19WebApi covid19WebApi = retrofit.create(Covid19WebApi.class);
      Call&lt;Covid19Model&gt; call = covid19WebApi.getData();//this is call api interfacee method
  
      call.enqueue(new Callback&lt;Covid19Model&gt;() {
          @Override
          public void onResponse(Call&lt;Covid19Model&gt; call, Response&lt;Covid19Model&gt; response) {
              responses = response.body().getResponse();
              for (Object data:responses){
                  System.out.println(data);//This my error (expected begin_array but was begin_object )
              }
          }
  
          @Override
          public void onFailure(Call&lt;Covid19Model&gt; call, Throwable t) {
            Toast.makeText(MainActivity.this,t.getLocalizedMessage().toString(),Toast.LENGTH_LONG).show();//this is toast message failure 
          }
      });
  
  }
  </code></pre>
  <p>}</p>
  <p><a href="https://i.stack.imgur.com/bq4Dh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bq4Dh.png" alt="My Api" /></a></p>
  <p>What is the problem
  My error code (&quot;expected begin_array but was begin_object&quot;)</p>
  <p>I can't find out what the problem is in these codes and the data doesn't come in response and gives an error instead</p>