How does java modify parameter values in a for loop?

        // 
        QueryFilter queryFilter0 = new QueryFilter();
        queryFilter0.addCommand(new Command("busStatus", Op.EQ, "0"));
        int taxStatus0 = taxInfoDao.getCount(queryFilter0);
        int businessStatus0 = businessInfoDao.getCount(queryFilter0);
        int socialSecurityStatus0 = socialSecurityDao.getCount(queryFilter0);
        int status0 = taxStatus0 + businessStatus0 + socialSecurityStatus0;
        // 
        QueryFilter queryFilter1 = new QueryFilter();
        queryFilter1.addCommand(new Command("busStatus", Op.EQ, "1"));
        int taxStatus1 = taxInfoDao.getCount(queryFilter1);
        int businessStatus1 = businessInfoDao.getCount(queryFilter1);
        int socialSecurityStatus1 = socialSecurityDao.getCount(queryFilter1);
        int status1 = taxStatus1 + businessStatus1 + socialSecurityStatus1;
        // 
        QueryFilter queryFilter2 = new QueryFilter();
        queryFilter2.addCommand(new Command("busStatus", Op.EQ, "2"));
        int taxStatus2 = taxInfoDao.getCount(queryFilter2);
        int businessStatus2 = businessInfoDao.getCount(queryFilter2);
        int socialSecurityStatus2 = socialSecurityDao.getCount(queryFilter2);
        int status2 = taxStatus2 + businessStatus2 + socialSecurityStatus2;
        // 
        QueryFilter queryFilter3 = new QueryFilter();
        queryFilter3.addCommand(new Command("busStatus", Op.EQ, "3"));
        int taxStatus3 = taxInfoDao.getCount(queryFilter3);
        int businessStatus3 = businessInfoDao.getCount(queryFilter3);
        int socialSecurityStatus3 = socialSecurityDao.getCount(queryFilter3);
        int status3 = taxStatus3 + businessStatus3 + socialSecurityStatus3;

there are four groups of such code from status0 to status3.
does java have this function? write a function that uses a for loop

.
  JSONObject result = new JSONObject();
  for(int i = 0; i < 4 ;iPP){
    QueryFilter queryFilteri = new QueryFilter();
    queryFilteri.addCommand(new Command("busStatus", Op.EQ, "i"));
    int taxStatusi = taxInfoDao.getCount(queryFilteri);
    int businessStatusi = businessInfoDao.getCount(queryFilteri);
    int socialSecurityStatusi = socialSecurityDao.getCount(queryFilteri);
    int result = taxStatusi + businessStatusi + socialSecurityStatusi;
    result.put("statusi", statusi);
   }
   

of course I"m wrong to write this, but is there any function that can implement this function?

Jun.22,2021

just a little change:

JSONObject result = new JSONObject();
  for(int i = 0; i < 4 ;iPP){
    QueryFilter queryFilteri = new QueryFilter();
    queryFilteri.addCommand(new Command("busStatus", Op.EQ, i+""));
    int taxStatusi = taxInfoDao.getCount(queryFilteri);
    int businessStatusi = businessInfoDao.getCount(queryFilteri);
    int socialSecurityStatusi = socialSecurityDao.getCount(queryFilteri);
    int result = taxStatusi + businessStatusi + socialSecurityStatusi;
    result.put("status"+i, statusi);
   }

shouldn't this be done in an array? Congratulations, seeing a piece of shit-like code to optimize it is the only way to grow into a senior engineer. You see, those masters are covered with shit.

QueryFilter[] queryFilter = new QueryFilter[4];
int[] taxStatus = new int[4];
int[] businessStatus = new int[4];
int[] socialSecurityStatus = new int[4];
int[] status = new int[4];

for(int i = 0; i < 4; iPP) {
    queryFilter[i] = new QueryFilter();
    queryFilter[i].addCommand(new Command("busStatus", Op.EQ, "" + i));
    taxStatus[i] = taxInfoDao.getCount(queryFilter[i]);
    businessStatus[i] = businessInfoDao.getCount(queryFilter[i]);
    socialSecurityStatus[i] = socialSecurityDao.getCount(queryFilter[i]);
    status[i] = taxStatus[i] + businessStatus[i] + socialSecurityStatus[i];
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3f5a2-2c49d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3f5a2-2c49d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?