Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

calling a void method java

public class methods{
  public static void main(String[] args){
    printSum(5, 15); // Print 20
  }
  public static void printSum(int a, int b){
    System.out.println(a + b);
  }
  // Our method should be outside the main methods bounds
  // Call your function inside the main method.
}
Source by examples.javacodegeeks.com #
 
PREVIOUS NEXT
Tagged: #calling #void #method #java
ADD COMMENT
Topic
Name
4+7 =