Here I counld not understand your quection well.but as i understood you couldn't able to put objects details into array list.In that case i can give you a tip for your problem.If this is not suffient to solve your problem please give more details.Thanks very much.
import java.util.ArrayList;
public class TaxpayerGroup {
private Taxpayer []object=new Taxpayer[4]; //object array
private ArrayList<Taxpayer> Tax=new ArrayList<Taxpayer>(); //arraylist to those all objects
public TaxpayerGroup()
{
object[0]=new Taxpayer("ravi", 23); //initialize object
object[1]=new Taxpayer("chanaka", 24);
object[2]=new Taxpayer("sirimanna", 25);
object[3]=new Taxpayer("yashodha", 22);
Tax.add(object[0]); //add to the arraylist
Tax.add(object[1]);
Tax.add(object[2]);
Tax.add(object[3]);
}
public void display()
{
int n=Tax.size();
for(int i=0;i<n;i++)
{
System.out.println(Tax.get(i).name+" "+Tax.get(i).age);
}
}
public static void main(String[] args) {
TaxpayerGroup TPG=new TaxpayerGroup();
TPG.display();
}
}
public class Taxpayer {
String name;
int age;
public Taxpayer(String A,int B)
{
name=A;
age=B;
}
}
This is only model.this is not answer for your problem.hope your reply....