title: retrieving values from the array of values from the server
body: <p>I have a piece of code and am trying to trace it. The code is:</p>
  
  <pre><code>if(response != null) 
          { 
  
              String line="";
  
              String strLine[]=new String[7];
  
              docids.clear();
              names.clear();
              specl.clear();
              qual.clear();
              exp.clear();
              loc.clear();
              cid.clear();
  
  
              passmsg="";
  
              //ArrayList&lt;String&gt; arrloc = new ArrayList&lt;String&gt;();
  
              InputStream inputstream = response.getEntity().getContent(); 
  
              //line[] = convertStreamToString(inputstream); 
  
              BufferedReader rd = new BufferedReader(new InputStreamReader(inputstream));
              try 
                  {
  
                  while ((line = rd.readLine()) != null) 
  
                      {
  
                      Toast.makeText(this,"Line:"+line , Toast.LENGTH_LONG).show();
                      strLine= line.split(",");
                      String errmsg,errno;
  
  
                      Integer a=Integer.parseInt(strLine[0]);
  
  
                      if(a==0)
                      {
  
  
                       Toast.makeText(this,"NO SESSION!!!" , Toast.LENGTH_LONG).show();
                       Intent myIntent = new Intent(getApplicationContext(),LoginActivity.class);
                       startActivityForResult(myIntent, 0);
  
                      }
  
                      else if(a==1)
                      {
  
                          errno=strLine[1];
                          if(errno.equals("61")||errno.equals("49"))
                              {
                              errmsg=strLine[2];
                               Toast.makeText(this,errmsg , Toast.LENGTH_LONG).show();
                              }
                          else if(errno.equals("194"))
                          {
                          errmsg=strLine[2];
                           Toast.makeText(this,errmsg , Toast.LENGTH_LONG).show();
                           e1.setText("");
                           e1.requestFocus();
                          }
  
                          else if(errno.equals("195"))
                          {
                          errmsg=strLine[2];
                           Toast.makeText(this,errmsg , Toast.LENGTH_LONG).show();
                           e2.setText("");
                           e2.requestFocus();
                          }
  
                          else if(errno.equals("62")) 
                              {
                              //whc=strLine[3];
  
                                  whc=which.toString();
  
                              if(whc.equals("1"))
                              {
                                  passmsg="Doctor List,Specialties";
                              }
  
                              else if(whc.equals("2"))
                              {
                                  passmsg="Doctor List,City Locations";
                              }
                              docids.add(strLine[3]);
  
  
  
                              names.add("Dr."+strLine[4]);
  
                              String sp=replace(strLine[5]);
                              specl.add("Specialities:"+sp);
  
                              String q=replace(strLine[6]);
                              qual.add("Qual:"+q);
  
                              exp.add("Exp:"+strLine[7]+"yrs");
  
                              if(whc.equals("1"))
                              {
                                  loc.add(replace(strLine[8]));
                              }
  
                              else if(whc.equals("2"))
                              {
  
                                  cid.add(strLine[9]);
                                  loc.add(strLine[8]+","+strLine[10]);
                              }
  </code></pre>
  
  <p>Code executes perfectly but my doubt is when array is declared as of 7 values <strong>String strLine[]=new String[7];</strong> we can only store values from 0 to 6th location. How is it possible to store and retrieve values of 7th location onwards?</p>
  
  <pre><code>cid.add(strLine[9]);
  loc.add(strLine[8]+","+strLine[10]);
  </code></pre>
  
  <p>Why am I not getting ArrayOutOfBoundException?</p>