Using methods from another class in the main?

后端 未结 3 1177
悲&欢浪女
悲&欢浪女 2021-01-27 03:08

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

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-27 03:37

    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);
    

提交回复
热议问题