I have two files:
I wanted to learn how to call the file "Test.java" a method that is in another file "other.java"
Thank you!
You either create an object of type Other
and then call the method on that object:
//in the Test class
Other obj = new Other();
obj.methodFromOther();
or if the method is static just call:
//in the Test class
Other.methodFromOther();
Maybe you should follow this tutorial to learn about the java programming language.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With