Hi

I came across this forum and was wondering if i could be enlightened!

This is what i am currently doing, is it bad programming? could you sudgest a better approach?

I have a superclass which has a method to return an ArrayList "list1":

public abstract class A
{
private ArrayList list1;

public ArrayList method1()
{
return list1;
}
}

my subclass uses method1 from superclass to access the arraylist from the superclass A and print the contents from it:

public class B extends A
{
public void printlist1()
{
Iterator it = method1().iterator();
while(it.hasNext())
{
system.out.println(it.next());
}
}
}

Any help on this subject would be great
Thanks alot