Passing a method from another class

后端 未结 4 501
渐次进展
渐次进展 2020-12-22 03:09

I want to call a method from one class to another, don\'t know if that\'s possible without extends the class that contains the method. I\'ve tried to import the package, tha

4条回答
  •  粉色の甜心
    2020-12-22 04:09

    Other way may be, create object for other class and then invoke the method on that object. Something like below.

    new ClassA().yourMethod();
    

提交回复
热议问题