We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, actually my problem is a bit wider than that : I have an abstract class A and several other classes that extends A, let's picking of these and call it B. I want to store in an ArrayList named All every B that is created during the execution of the program, except for some specific cases where I don't want B to be in All. I want to be able to do something like A.All.get(i). I tried to declare the field All static but I got the error : "The field All cannot be declared static; static fields can only be declared in static or top level types".
Can you help me with that ?