Answers for "call methods in java"

3

java methods

public class MyClass {
  static int myMethod(int x) {
    return 5 + x;
  }

  public static void main(String[] args) {
    System.out.println(myMethod(3));
  }
}
// Returns 8
Posted by: Guest on June-02-2020
0

create object and call method in java

MyClass **insert_name** = new MyClass();
        insert_name.**method_name**();
Posted by: Guest on September-16-2020

Code answers related to "call methods in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language