Class Instances stored in an ArrayList
Basicly I am trying to store multiple instances of a class in an Array List. I have already done this with a regular Array but I am in need of dynamic storage.
I have managed to store the instances in the ArrayList but I can't get the methods to work.
I also tried:
ArrayList managers = new ArrayList();
managers.add( new Manager(...) );
System.out.println( "User = "+manager.get(i).getUsername() );
Any help would be greatly appreciated, thank you.
Object obj1 = managers.get(i);
System.out.println( "User = "+obj1.getUsername() );