Methods with Parameters in Java Programming
In this tutorial, you will learn about java methods with parameters / arguments.
You will learn how to create methods which can take parameters, how to call them and pass arguments, how they work, what is the advantage of using them in detail with example
Source code for this video tutorial
package learningJava; public class Banana { public static void main(String[] args) { add(22,55,"anil"); add(66,88,"anjali"); add(77,100,"alex"); } public static void add(int num1,int num2,String name){ int result = num1 + num2; System.out.println("hey "+name+" wats up"); System.out.println(num1+" + "+num2+" = "+result); } }