Tracy Le wrote: . . . The program I am working on requires the showTotals to be static. I was able to fix that compiling error, but now my totals are not showing up correctly. . . .
That is not a compiler error. That is a design error. If you have marked something static because it compiles like that, there is a 99.9% probability that you have a serious design error about what is static and what isn’t.
You cannot correct a
non-static variable totals cannot be referenced from a static context
… error by making totals static. You correct it by making wherever it is referenced from non-static.