Okay so I did search this question and a decent amount of results showed up. All of them seemed to have pretty different scenarios though and the solutions were different for ea
If your method is a static
, you can call ClassName.methodName(arguments);
If your driver class not a static one you should create an instant of that class and call your method.
ClassName className=new ClassName();
className.displayEditParty(playerParty, tempEnemy);
I dont see where your declaring the Driver class in your code.
Driver foo = new Driver();
foo.displayEditParty(playerParty, tempEnemy);
You should make displayEditParty
function public static and then you can use it in other class by className.displayEditParty(?,?);
Methods of class can be accessible by that class's object only. Check below code:
class A{
void methodA(){
//Some logic
}
public static void methodB(){
//Some logic
}
}
public static void main(String args[]){
A obj = new A();
obj.methodA(); // You can use methodA using Object only.
A.methodB(); // Whereas static method can be accessed by object as well as
obj.methodB(); // class name.
}