title: I am getting Error like below in android using volley.error is , org.json.JSONException: Index 3 out of range [0..3)
body: <p>I am using volley library to achive network operation when i try to ru the program using below program i am gettin warning and getting size less than what i have in the url the warning message is org.json.JSONException: Index 3 out of range [0..3).</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  TextView results;   
  String JsonURL = "http://184.73.181.186/jsondata.php";
  String data = "";   
  RequestQueue requestQueue;
  MyCustomBaseAdapter myCustomBaseAdapter;
  ArrayList&lt;StudentInfo&gt; studentInfoList = new ArrayList&lt;StudentInfo&gt;();
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);     
      requestQueue = Volley.newRequestQueue(this);       
      results = (TextView) findViewById(R.id.jsonData);      
      JsonArrayRequest arrayreq = new JsonArrayRequest(JsonURL,                               
              new Response.Listener&lt;JSONArray&gt;() {
                  @Override
                  public void onResponse(JSONArray response) {                      
                      try {                      
                    for(int i=0;i&lt;lenghthofarray;i++){
                              JSONObject jresponse = response.getJSONObject(i);
                              final int numberOfItemsInResp = jresponse.length();
                              StudentInfo studentInfo = new StudentInfo();
                              String fname = jresponse.getString("fName");
                              String lName = jresponse.getString("lName");
                              String rollNo = jresponse.getString("rollNo");
                              String profilePic =  jresponse.getString("profilePic");
                              studentInfo.setFname(fname);
                              studentInfo.setLname(lName);
                              studentInfo.setRoolNo(rollNo);
                              studentInfo.setStudpic(profilePic);
                              studentInfoList.add(studentInfo);
  
                              list.add(profilePic);
                              myCustomBaseAdapter = new MyCustomBaseAdapter(getApplicationContext(),studentInfoList);
  
  
  
  
  
                              JSONObject colorObj = response.getJSONObject(0);
  
                          JSONArray colorArry = colorObj.getJSONArray("marks");                        
  
                          for (int ii = 0; ii &lt; colorArry.length(); ii++) {
  
                              JSONObject jsonObject = colorArry.getJSONObject(i);
  
  
                              String subjectName, marks;
                              subjectName = jsonObject.getString("subjectName");
                              marks = jsonObject.getString("marks");
  
                          }
                              data += "\nfName " + fname +
                                      "\nHex Value : " + lName + "\n\n\n"+rollNo+"\n"+profilePic+"\n";
                          }
                          results.setText(data);
                      } catch (JSONException e) {
                          e.printStackTrace();
                      }
          }
      },
  
  
              new Response.ErrorListener() {
                  @Override
                  // Handles errors that occur due to Volley
                  public void onErrorResponse(VolleyError error) {
                      Log.e("Volley", "Error");
                  }
              }
      );
  
  }
  </code></pre>
  
  <p>}</p>