Answers for "how to call method from another class"

3

java call method from another class example

public class method{
  public static void sayHello(){
    System.out.println("Hello World");
  }
}
public class app{
  public static void main(String[] args){
    method m = new method(); // Creating an instance from our class
    m.sayHello(); // using the class methods by the instance we created.
  }
}
Posted by: Guest on June-18-2021
0

call methods from within a class

def isNear(self, p):
    self.distToPoint(p)
    ...
Posted by: Guest on May-23-2021

Code answers related to "how to call method from another class"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language