Example Passing Arguments
public class PassingArguments {
public void test(int x, int y, int[] array) {
System.out.println("inside test method x:" + x + " y:" + y +
" array[0]:" +array[0] );
public static void main(String[] argv) {
System.out.println("Before the test call a:" + a + " b:" + b + " ar[0]:" +ar[0]);
PassingArguments pa = new PassingArguments();
System.out.println("After the test call a:" + a + " b:" + b + " ar[0]:" +ar[0]);
Before the test call a:5 b:10 ar[0]:15
inside test method x:1 y:2 array[0]:5
After the test call a:5 b:10 ar[0]:5