Java methods

Your video will begin in 10
80 Views
Published
Java methods tutorial explained

#java #methods #tutorial

public class Main {

public static void main(String[] args) {

// method = a block of code that is executed whenever it is called upon

int x = 3;
int y = 4;

int z = add(x,y);

System.out.println(z);
}

static int add(int x, int y) {

int z = x + y;
return z;

}

}
Category
Bro Code
Tags
java methods, methods java, java methods and classes tutorial
Be the first to comment