for(int i=0;i<list.size();i++){ questionTypes = new QuestionTypes(); Object[] object=(Object[])list.get(i); questionTypes.setId(object[0].toString()); String testId =object[0].toString(); questionTypes.setQuestionTypeName(object[3].toString()); String testName =object[3].toString(); questionList.add(questionTypes);