Using a static variable to sum everything up means that all instances of the Agent class will be part of the sum. That also includes instances which are created in a totally different spot of the application
JDBCSupport - An easy to use, light-weight JDBC framework -
I took Sunny X Narula solution and modified it so that I can choose the variables to be summed up. Anyway too make this nicer?
What bothers me is that there are five lines in the main routine to get the sum. I would like a solution, where we have to write only one line of code in the main routine, to get the sum of any agent variable.
They worship nothing. They say it's because nothing lasts forever. Like this tiny ad: