I'm not sure what you mean by 'iterate through elements of a class', but you can declare static member variables in Java that will be shared by all instances.
So you can declare a static counter that is incremented in the constructor to track the number of instances, or a static list to which each new instance is added, so all instances are sequentially available, etc.
You only have to read a Java primer to discover this, so I'm guessing you want to do something more - can you clarify your requirement?