Originally Posted by
JavaDaveUK
I think you need to understand how the compiler works, it creates .class files from source files .java, you actually cannot call a method from a .java file, but you can from the compiled file .class.
So to answer your question, yes you can call a method from a class file, just make sure it resides on your classpath so the JVM you are running under can see it.
Incidentally IDE's are effectively looking at the .class files to determine what methods are available, this is obviously hidden from the developer.
This is quite an old thread, but i really would like some help in this matter, with an example, probably? Like, how to the class file method say 'fn1' in class file 'myjava.class' can be called from a method 'fn2' in another java file, say 'mynewjava.java'??
Thanks in advance