I know in java you can create an array or list(honestly I forget which one) that you can store a series of classes. I want to be able to have a program that has one of those lists and will loop through each class and run a certain method in each class(yes all the classes extend one abstract class) in a new thread. Is this possible? I am very sorry if I am not describing my problem well if some people comment and say I need to describe it better I will attempt to.
Share
(tweaking StriplingWarrior’s example class names here to show how to thread it)
To run in a thread your classes need to
implement Runnable, i.e. contain the methodpublic void run(), thus:Then, for each element in your list: