File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Static main and non-static External class... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Static main and non-static External class..." Watch "Static main and non-static External class..." New topic
Author

Static main and non-static External class...

Sam Smoot
Ranch Hand

Joined: Apr 18, 2002
Posts: 238
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...


CNSS/NSA Infosec Professional,<br />Software Engineer
Sam Smoot
Ranch Hand

Joined: Apr 18, 2002
Posts: 238
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

Joined: Dec 10, 2001
Posts: 7023
So, what did you figure out?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Static main and non-static External class...
 
Similar Threads
The method showMessageDialog(Component, Object) in the type JOptionPane is not applic
final variable initialization
Swap function in java
Need help with Overloading Methods
Erroneous sym type What does this mean?