Yes, reflection could be used, but it would be a very obscure and complicated solution. This being the beginner forum, we should not get into that, but rather talk about how to use
Java objects to solve the problem.
I am of course assuming that the
actual problem is not "how to access variables called mac1, mac2, ..." but rather "how to store a varying a number of variables under the name
mac".
(By the way, I don't think the smiley you used means what you think it means:
http://faq.javaranch.com/java/SaloonGraemlins)
[ January 17, 2008: Message edited by: Ulf Dittmer ]