• Post Reply Bookmark Topic Watch Topic
  • New Topic

Static main and non-static External class...  RSS feed

 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm posting this here because I haven't coded (consistantly) in 13 months (long story, maby later posted in meaningless drivel section) but I have a common (newbie) problem.


I have the following class coded as such :



To run it, I have the following code:



Needless to say, I have the problem with the compile in that it tells me that I can't access non-static addNumbers from static context. I need to run the class external to the calling class for a larger project, and I am just trying to test (and refresh my memory, which is obviously shot ) how to pass to/from external classes.

I know there is a really easy fix to this, but I can't seem to get it...

Thanks in advance...
 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind.. Got it after posting this one. :roll:

Not enough sleep, caffeene, chocolate, beer, or any of the other real building blocks of fine coders everywhere

Thanks anyway..
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, what did you figure out?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!