Best ways to reuse Java methods
- by carillonator
I'm learning Java and OOP, and have been doing the problems at Project Euler for practice (awesome site btw).
I find myself doing many of the same things over and over, like:
checking if an integer is prime/generating primes
generating the Fibonacci series
checking if a number is a palindrome
What is the best way to store and call these methods? Should I write a utility class and then import it? If so, do I import a .class file or the .java source? I'm working from a plain text editor and the Mac terminal.
Thanks!