How to use functions in separate files
Hi, I'm writing a program in JAVA2 and since I want it to be as modular as possible I would like to create some functions (or routines) in separate files and then use them in the main program by calling them. For example lets say that in one file I have a function which takes 2 integers and returns their sum and I want to use it in my main program which is in another file.How can I do that??
I know it must be trivial but no matter what I do when I compile the main program it says that it doesn't recognize the function so I'm forced to put the function inside the main program.