Simply is it possible to create a type, in java, which can be passed into the foreach loop after the colon? And if so, how?
At first I thought I that foreach only worked for arrays, but then it came to my attention that Lists could be iterated over. My question is then is this something that the interpreter does automatically or is it possible to create classes of my own which can be used?