Java: Get instantiated object with a string
I have an ArrayList containing names of instantiated objects that I want
to execute the method 'count' on. I'm unsure if/how to do that, though. I
have a loop to scan through the array list, and added pseudocode with what
I'm trying to achieve.
n = 0;
while(n <= arrayList.size()){
(arrayList.get(n)).count();
}
I'm new to java and am not sure this is possible, but any help would be
appreciated. Thanks.
No comments:
Post a Comment