json - Java - Retrive next 50 results -


rob = response.getjsonobject();  array = rob.getjsonarray("data"); fr = new arraylist(); int count = array.length();  (int = 0; < array.length(); i++) {         friend = array.getjsonobject(i);        fr.add(friend.get("name"));  } 

here fr array list.

i want select first 50 result output names.

then next 50 result output , next 50, on until response ends.

is there way can ? itrate or loop ?

for(int = 0; i<fr.size(); i++){    system.out.print(fr[i]+",")    if(i%5==0) system.out.println(); } 

tried above code result in untable time select 1 time .

are looking this?

for (int = 0; < fr.size(); i++) {     system.out.print(fr[i]+",");     if ((i + 1) % 50 == 0) { // have use + 1 because otherwise modulo logic won't work         system.out.print("\n");     } } 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -